From ddd731bc09c4f5212611a11720bac19149f26f5e Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Thu, 25 Mar 2021 17:51:17 +0000 Subject: [PATCH] module-access: Plug /.flatpak-info fd leak The file descriptor needs to be closed in all situations, not only in the fstat error case. --- src/modules/module-access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/module-access.c b/src/modules/module-access.c index f0daa953c..1a87ff016 100644 --- a/src/modules/module-access.c +++ b/src/modules/module-access.c @@ -144,9 +144,9 @@ static int check_flatpak(struct pw_impl_client *client, int pid) } if (fstat (info_fd, &stat_buf) != 0 || !S_ISREG (stat_buf.st_mode)) { /* Some weird fd => failure, assume sandboxed */ - close(info_fd); pw_log_error("error fstat .flatpak-info: %m"); } + close(info_fd); return 1; }