From: Dagobert Michelsen Date: Thu, 28 May 2015 11:19:02 +0000 (+0200) Subject: Handle case when zone_scandir() returns NULL X-Git-Tag: collectd-5.6.0~709^2~4 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=1d2d244077bd02f5ab7b53aef27f8d6e343f8a4a;p=collectd.git Handle case when zone_scandir() returns NULL --- 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); }