chiark / gitweb /
condition: Fix file descriptor leak in test_capability()
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Wed, 26 Oct 2011 07:38:39 +0000 (09:38 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 1 Nov 2011 16:02:32 +0000 (17:02 +0100)
Detected by cppcheck.

src/condition.c

index f18c454..2b51a16 100644 (file)
@@ -187,6 +187,8 @@ static bool test_capability(const char *parameter) {
                 }
         }
 
+        fclose(f);
+
         return !!(capabilities & (1ULL << value));
 }