From: Ruben Kerkhof Date: Fri, 4 Dec 2015 22:08:46 +0000 (+0100) Subject: turbostat plugin: close fd on error X-Git-Tag: collectd-5.5.1~32 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=d3c85c866ae36ca8fefb044eeb121d42e14ede38;p=collectd.git turbostat plugin: close fd on error Signed-off-by: Florian Forster --- 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);