wayland: Ensure we close the fd on all error paths in data_source.send
https://bugzilla.gnome.org/show_bug.cgi?id=751414
This commit is contained in:
@ -643,7 +643,10 @@ data_source_send (void *data,
|
|||||||
G_STRFUNC, source, mime_type, fd);
|
G_STRFUNC, source, mime_type, fd);
|
||||||
|
|
||||||
if (!mime_type)
|
if (!mime_type)
|
||||||
return;
|
{
|
||||||
|
close (fd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
context = gdk_wayland_drag_context_lookup_by_data_source (source);
|
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)
|
else if (source == wayland_selection->clipboard_source)
|
||||||
window = wayland_selection->clipboard_owner;
|
window = wayland_selection->clipboard_owner;
|
||||||
else
|
else
|
||||||
return;
|
{
|
||||||
|
close (fd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!gdk_wayland_selection_request_target (wayland_selection, window,
|
if (!gdk_wayland_selection_request_target (wayland_selection, window,
|
||||||
gdk_atom_intern (mime_type, FALSE),
|
gdk_atom_intern (mime_type, FALSE),
|
||||||
|
|||||||
Reference in New Issue
Block a user