From: Dagobert Michelsen Date: Thu, 28 May 2015 11:09:49 +0000 (+0200) Subject: Handle case when zone_find_stats() returns NULL X-Git-Tag: collectd-5.6.0~709^2~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5a7b3083a24416a12f59734209ebec47298c4d8b;p=collectd.git Handle case when zone_find_stats() returns NULL --- diff --git a/src/zone.c b/src/zone.c index 325d5567..c5eacefd 100644 --- a/src/zone.c +++ b/src/zone.c @@ -162,8 +162,10 @@ zone_scandir(DIR *procdir) sizeof(psinfo_t)) != 0) continue; stats = zone_find_stats(tree, psinfo.pr_zoneid); - stats->pctcpu += psinfo.pr_pctcpu; - stats->pctmem += psinfo.pr_pctmem; + if( stats ) { + stats->pctcpu += psinfo.pr_pctcpu; + stats->pctmem += psinfo.pr_pctmem; + } } return(tree); }