Code

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

index 52dd977becb1104b6638c47afa415aed7aa76801..e4aad81513bb2b9858139d3990e31de924f6b73f 100644 (file)
@@ -188,6 +188,9 @@ static int zone_read (void)
 
        tree=zone_scandir(procdir);
        closedir(procdir);
+       if (tree == NULL) {
+               return (-1);
+       }
        zone_submit_values(tree); /* this also frees tree */
        return (0);
 }