[systemd-devel] [PATCH] Fix file descriptor leak in test_capability()

Lennart Poettering lennart at poettering.net
Tue Nov 1 09:06:55 PDT 2011


On Wed, 26.10.11 09:38, Thomas Jarosch (thomas.jarosch at intra2net.com) wrote:

> Detected by cppcheck.

Thanks! Applied!
> 
> Signed-off-by: Thomas Jarosch <thomas.jarosch at intra2net.com>
> ---
>  src/condition.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/src/condition.c b/src/condition.c
> index f18c454..2b51a16 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));
>  }
>  


Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list