diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2015-06-24 21:55:12 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2015-06-24 23:52:50 +0200 |
commit | fb266a8876fbba4a983ddb9f6d11295c1e27ef7d (patch) | |
tree | 4866d9f2aaea57e4058bb04153dc59eabb72eb3b | |
parent | 3bd7b2a6fb31a3cf379466b08c497552f0c27c0f (diff) | |
download | gtk+-fb266a8876fbba4a983ddb9f6d11295c1e27ef7d.tar.gz |
wayland: Ensure we close the fd on all error paths in data_source.send
https://bugzilla.gnome.org/show_bug.cgi?id=751414
-rw-r--r-- | gdk/wayland/gdkselection-wayland.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gdk/wayland/gdkselection-wayland.c b/gdk/wayland/gdkselection-wayland.c index c5d0089579..ac5d38e22d 100644 --- a/gdk/wayland/gdkselection-wayland.c +++ b/gdk/wayland/gdkselection-wayland.c @@ -643,7 +643,10 @@ data_source_send (void *data, G_STRFUNC, source, mime_type, fd); if (!mime_type) - return; + { + close (fd); + return; + } context = gdk_wayland_drag_context_lookup_by_data_source (source); @@ -652,7 +655,10 @@ data_source_send (void *data, else if (source == wayland_selection->clipboard_source) window = wayland_selection->clipboard_owner; else - return; + { + close (fd); + return; + } if (!gdk_wayland_selection_request_target (wayland_selection, window, gdk_atom_intern (mime_type, FALSE), |