summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2014-08-20 20:53:22 +0200
committerCarlos Garnacho <carlosg@gnome.org>2014-08-22 13:24:48 +0200
commit88bf4a7a2d442c4c86a59488851225db5c05e001 (patch)
tree93b4fbdb1eae696d3adc18f27c4a796c9f21e196 /gdk
parentd9ea7cda80e12afbe2abf85be38cfb3a01b550ca (diff)
downloadgtk+-88bf4a7a2d442c4c86a59488851225db5c05e001.tar.gz
x11: Fix possible leak of GdkEvents
If the filter didn't return GDK_EVENT_TRANSLATE, the event struct would be left unused and leaked.
Diffstat (limited to 'gdk')
-rw-r--r--gdk/x11/gdkdnd-x11.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index 311c9b304d..e38e1f35fb 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -1144,10 +1144,9 @@ xdnd_send_xevent (GdkX11DragContext *context_x11,
temp_event->any.window = g_object_ref (window);
if ((*xdnd_filters[i].func) (event_send, temp_event, NULL) == GDK_FILTER_TRANSLATE)
- {
- gdk_event_put (temp_event);
- gdk_event_free (temp_event);
- }
+ gdk_event_put (temp_event);
+
+ gdk_event_free (temp_event);
return TRUE;
}