From 1d2d244077bd02f5ab7b53aef27f8d6e343f8a4a Mon Sep 17 00:00:00 2001 From: Dagobert Michelsen Date: Thu, 28 May 2015 13:19:02 +0200 Subject: [PATCH] Handle case when zone_scandir() returns NULL --- src/zone.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/zone.c b/src/zone.c index 52dd977b..e4aad815 100644 --- a/src/zone.c +++ b/src/zone.c @@ -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); } -- 2.11.0