From: Carlos Garnacho Date: Wed, 24 Jun 2015 19:55:12 +0000 (+0200) Subject: wayland: Ensure we close the fd on all error paths in data_source.send X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~24^2~9280 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fb266a8876fbba4a983ddb9f6d11295c1e27ef7d;p=gtk4.git wayland: Ensure we close the fd on all error paths in data_source.send https://bugzilla.gnome.org/show_bug.cgi?id=751414 --- 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),