Code

turbostat plugin: close fd on error
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 4 Dec 2015 22:08:46 +0000 (23:08 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 5 Dec 2015 07:53:43 +0000 (08:53 +0100)
Signed-off-by: Florian Forster <octo@collectd.org>
src/turbostat.c

index 42fed52a3e496b8e87036f20150023ce50a56ff2..5ab073d547d073fb3d4544143fb3d7f01dd82530 100644 (file)
@@ -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);