mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
connection: close_fds() should only remove fds it closed from the buffer
All current callers close all fds, so this has gone unnoticed, but if we close less than all fds with close_fds() we leak all the unclosed ones and ruin further event demarshalling. A future patch will close less than the full buffer's worth of fds, so this is now noticed. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
c3ff179a95
commit
971a9e7873
1 changed files with 1 additions and 0 deletions
|
|
@ -186,6 +186,7 @@ close_fds(struct wl_buffer *buffer, int max)
|
|||
count = size / sizeof fds[0];
|
||||
if (max > 0 && max < count)
|
||||
count = max;
|
||||
size = count * sizeof fds[0];
|
||||
for (i = 0; i < count; i++)
|
||||
close(fds[i]);
|
||||
buffer->tail += size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue