mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
shm: Avoid file descriptor leak upon unsuccessful mmap
It would be possible to make the compositor leak file descriptors by passing descriptors of open unmmapable files to it, such as /dev/null. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
This commit is contained in:
parent
c2bba88ccd
commit
4a196570a3
1 changed files with 1 additions and 1 deletions
|
|
@ -241,7 +241,7 @@ shm_create_pool(struct wl_client *client, struct wl_resource *resource,
|
||||||
wl_resource_post_error(resource,
|
wl_resource_post_error(resource,
|
||||||
WL_SHM_ERROR_INVALID_FD,
|
WL_SHM_ERROR_INVALID_FD,
|
||||||
"failed mmap fd %d", fd);
|
"failed mmap fd %d", fd);
|
||||||
goto err_free;
|
goto err_close;
|
||||||
}
|
}
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue