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://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7670e5a2aab543bc6b442ab0683411770e06fe26;p=elogind.git condition: Fix file descriptor leak in test_capability() Detected by cppcheck. --- diff --git a/src/condition.c b/src/condition.c index f18c45421..2b51a16f1 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)); }