From 5a7b3083a24416a12f59734209ebec47298c4d8b Mon Sep 17 00:00:00 2001 From: Dagobert Michelsen Date: Thu, 28 May 2015 13:09:49 +0200 Subject: [PATCH] Handle case when zone_find_stats() returns NULL --- src/zone.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } -- 2.30.2