From: Ruben Kerkhof Date: Sat, 28 Nov 2015 22:15:24 +0000 (+0100) Subject: fhcount plugin: close file descriptor on failure X-Git-Tag: collectd-5.5.1~41 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=688eabfd18b75ece2df552c7988caf3b374d45fd;p=collectd.git fhcount plugin: close file descriptor on failure --- diff --git a/src/fhcount.c b/src/fhcount.c index 4c409b58..666dacc0 100644 --- a/src/fhcount.c +++ b/src/fhcount.c @@ -98,6 +98,7 @@ static int fhcount_read(void) { } if (fgets(buffer, buffer_len, fp) == NULL) { ERROR("fhcount: fgets: %s", sstrerror(errno, errbuf, sizeof(errbuf))); + fclose(fp); return(EXIT_FAILURE); } fclose(fp);