summaryrefslogtreecommitdiff
path: root/src/bootchart
diff options
context:
space:
mode:
authorAndreas Henriksson <andreas@fatal.se>2014-09-16 19:40:25 +0200
committerTom Gundersen <teg@jklm.no>2014-09-16 20:25:30 +0200
commitd498a616075ebfd8025d66c4c4f725d24eb3aca3 (patch)
tree4867446728142ef07be075272be94eb07c1de745 /src/bootchart
parente10f3c431a3bc1a94fbe9d2a14d3025550f9672e (diff)
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
Diffstat (limited to 'src/bootchart')
-rw-r--r--src/bootchart/store.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bootchart/store.c b/src/bootchart/store.c
index ed46a503c6..ed683e88d9 100644
--- a/src/bootchart/store.c
+++ b/src/bootchart/store.c
@@ -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);
}