bootchart: oom-check correct variable

Coverity warned that we have already dereferenced ps->sample before
null-checking it. I suspect that's not really the issue and that
the check is checking the wrong variable.
Likely the oom-check should be on the just allocated ps->sample->next.

Found by coverity. Fixes: CID#1237765
This commit is contained in:
Andreas Henriksson 2014-09-16 19:40:25 +02:00 committed by Tom Gundersen
parent e10f3c431a
commit d498a61607

View file

@ -399,7 +399,7 @@ schedstat_next:
continue;
ps->sample->next = new0(struct ps_sched_struct, 1);
if (!ps->sample) {
if (!ps->sample->next) {
log_oom();
exit(EXIT_FAILURE);
}