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 325d556..c5eacef 100644 (file)
@@ -162,8 +162,10 @@ zone_scandir(DIR *procdir)
                                  sizeof(psinfo_t)) != 0)
                        continue;
                stats = zone_find_stats(tree, psinfo.pr_zoneid);
                                  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);
 }
        }
        return(tree);
 }