mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
module-access: don't leak the fd in check_cmdline
This commit is contained in:
parent
2340ae40a8
commit
7a7a12138f
1 changed files with 7 additions and 2 deletions
|
|
@ -59,12 +59,17 @@ static int check_cmdline(struct pw_client *client, const struct ucred *ucred, co
|
|||
if (fd < 0)
|
||||
return -errno;
|
||||
|
||||
if (read(fd, path, 1024) <= 0)
|
||||
if (read(fd, path, 1024) <= 0) {
|
||||
close(fd);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
if (strcmp(path, str) == 0)
|
||||
if (strcmp(path, str) == 0) {
|
||||
close(fd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue