Code

Handle case when zone_find_stats() returns NULL
authorDagobert Michelsen <dam@opencsw.org>
Thu, 28 May 2015 11:09:49 +0000 (13:09 +0200)
committerDagobert Michelsen <dam@opencsw.org>
Thu, 28 May 2015 11:09:49 +0000 (13:09 +0200)
src/zone.c

index 325d556701563910099a7ff662e609c98abb937f..c5eacefd17da7e9aa49a2da28ef76b6c3c759969 100644 (file)
@@ -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);
 }