From 427312c8ec789eca727ddd0293240a077bc22cc4 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.11.0