From d3c85c866ae36ca8fefb044eeb121d42e14ede38 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 4 Dec 2015 23:08:46 +0100 Subject: [PATCH] turbostat plugin: close fd on error Signed-off-by: Florian Forster --- src/turbostat.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/turbostat.c b/src/turbostat.c index 42fed52a..5ab073d5 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -1037,6 +1037,7 @@ parse_int_file(const char *fmt, ...) } if (fscanf(filep, "%d", &value) != 1) { ERROR("turbostat plugin: Failed to parse number from '%s'", path); + fclose(filep); return -1; } fclose(filep); -- 2.11.0