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.6.0~556^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=427312c8ec789eca727ddd0293240a077bc22cc4;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);