From 688eabfd18b75ece2df552c7988caf3b374d45fd Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 28 Nov 2015 23:15:24 +0100 Subject: [PATCH] fhcount plugin: close file descriptor on failure --- src/fhcount.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.30.2