commit 239ba39331420f953de35c337ae57db35573f9cb which was intended
to stop leaking fds in events for zombie objects didn't notice that
passing 0 to wl_connection_close_fds_in() would still close fds.

Test the fd count before calling.

Signed-off-by: Derek Foreman <der...@osg.samsung.com>
---
 src/wayland-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/wayland-client.c b/src/wayland-client.c
index c1369b8..1ffa1f0 100644
--- a/src/wayland-client.c
+++ b/src/wayland-client.c
@@ -1359,7 +1359,7 @@ queue_event(struct wl_display *display, int len)
        if (!proxy || wl_object_is_zombie(&display->objects, id)) {
                struct wl_zombie *zombie = wl_map_lookup(&display->objects, id);
 
-               if (zombie)
+               if (zombie && zombie->fd_count[opcode]) {
                        wl_connection_close_fds_in(display->connection,
                                                   zombie->fd_count[opcode]);
 
-- 
2.14.3

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to