module-access: Plug /.flatpak-info fd leak

The file descriptor needs to be closed in all situations, not only in the fstat
error case.
This commit is contained in:
Philippe Normand 2021-03-25 17:51:17 +00:00 committed by Wim Taymans
parent 3d82700edb
commit ddd731bc09

View file

@ -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)) { if (fstat (info_fd, &stat_buf) != 0 || !S_ISREG (stat_buf.st_mode)) {
/* Some weird fd => failure, assume sandboxed */ /* Some weird fd => failure, assume sandboxed */
close(info_fd);
pw_log_error("error fstat .flatpak-info: %m"); pw_log_error("error fstat .flatpak-info: %m");
} }
close(info_fd);
return 1; return 1;
} }