summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2013-11-15 13:17:56 (GMT)
committerKristian Høgsberg <krh@bitplanet.net>2013-11-16 00:21:45 (GMT)
commit4a196570a3f528e9092014f8320f4a2bb4aba680 (patch)
tree58d6b83e941c2f712258cce16ec77c17ea28116f
parentc2bba88ccd68c5ea6792a875499cec276db594f8 (diff)
downloadwayland-4a196570a3f528e9092014f8320f4a2bb4aba680.tar.gz
wayland-4a196570a3f528e9092014f8320f4a2bb4aba680.tar.xz
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>
-rw-r--r--src/wayland-shm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wayland-shm.c b/src/wayland-shm.c
index 814a4cf..590f775 100644
--- a/src/wayland-shm.c
+++ b/src/wayland-shm.c
@@ -241,7 +241,7 @@ shm_create_pool(struct wl_client *client, struct wl_resource *resource,
wl_resource_post_error(resource,
WL_SHM_ERROR_INVALID_FD,
"failed mmap fd %d", fd);
- goto err_free;
+ goto err_close;
}
close(fd);