From: Thomas Jarosch Date: Wed, 26 Oct 2011 07:38:39 +0000 (+0200) Subject: condition: Fix file descriptor leak in test_capability() X-Git-Tag: v38~217 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7670e5a2aab543bc6b442ab0683411770e06fe26;p=systemd condition: Fix file descriptor leak in test_capability() Detected by cppcheck. --- diff --git a/src/condition.c b/src/condition.c index f18c4542..2b51a16f 100644 --- a/src/condition.c +++ b/src/condition.c @@ -187,6 +187,8 @@ static bool test_capability(const char *parameter) { } } + fclose(f); + return !!(capabilities & (1ULL << value)); }