diff options
author | Matthias Clasen <mclasen@redhat.com> | 2005-08-19 05:46:06 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2005-08-19 05:46:06 +0000 |
commit | 859126d5466f67b120df73b02e994baa08554a6c (patch) | |
tree | c0d8a38478fb0cdb1ee9fcc4b0159368adc8f8b5 /gdk | |
parent | ba8fd4b9e29f3861a23381a73c67264d2f662637 (diff) | |
download | gtk+-859126d5466f67b120df73b02e994baa08554a6c.tar.gz |
Free data returned from XGetWindowProperty.
2005-08-19 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkdnd-x11.c (_gdk_drag_get_protocol_for_display)
(xdnd_read_actions, get_client_window_at_coords_recurse):
Free data returned from XGetWindowProperty.
* gdk/x11/gdkevents-x11.c (fetch_net_wm_check_window)
Free data returned from XGetWindowProperty. (313867, Kjartan
Maraas)
* gdk/x11/gdkdnd-x11.c (get_client_window_at_coords_recurse): Free
children in all cases. (#313862, Kjartan Maraas)
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/x11/gdkdnd-x11.c | 14 | ||||
-rw-r--r-- | gdk/x11/gdkevents-x11.c | 11 |
2 files changed, 20 insertions, 5 deletions
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index 9dbb54f29a..cca5cce857 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -2485,6 +2485,7 @@ xdnd_read_actions (GdkDragContext *context) gdk_error_trap_push (); + data = NULL; if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_DRAWABLE_XID (context->source_window), gdk_x11_get_xatom_by_name_for_display (display, "XdndActionList"), @@ -2520,8 +2521,10 @@ xdnd_read_actions (GdkDragContext *context) } #endif /* G_ENABLE_DEBUG */ - XFree(atoms); } + + if (data) + XFree (data); gdk_error_trap_pop (); } @@ -2739,6 +2742,10 @@ xdnd_enter_filter (GdkXEvent *xev, if (gdk_error_trap_pop () || (format != 32) || (type != XA_ATOM)) { g_object_unref (new_context); + + if (data) + XFree (data); + return GDK_FILTER_REMOVE; } @@ -3086,7 +3093,10 @@ _gdk_drag_get_protocol_for_display (GdkDisplay *display, 0, 0, False, AnyPropertyType, &type, &format, &nitems, &data) && type != None) - rootwin = TRUE; + { + XFree (data); + rootwin = TRUE; + } } #endif diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c index 63a22cbd36..0a273a4b6b 100644 --- a/gdk/x11/gdkevents-x11.c +++ b/gdk/x11/gdkevents-x11.c @@ -2555,13 +2555,18 @@ fetch_net_wm_check_window (GdkScreen *screen) if (screen_x11->wmspec_check_window != None) return; /* already have it */ + data = NULL; XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), screen_x11->xroot_window, gdk_x11_get_xatom_by_name_for_display (display, "_NET_SUPPORTING_WM_CHECK"), 0, G_MAXLONG, False, XA_WINDOW, &type, &format, &n_items, &bytes_after, &data); if (type != XA_WINDOW) - return; + { + if (data) + XFree (data); + return; + } xwindow = (Window *)data; @@ -2574,14 +2579,14 @@ fetch_net_wm_check_window (GdkScreen *screen) if (gdk_error_trap_pop () == Success) { screen_x11->wmspec_check_window = *xwindow; - XFree (xwindow); - screen_x11->need_refetch_net_supported = TRUE; screen_x11->need_refetch_wm_name = TRUE; /* Careful, reentrancy */ _gdk_x11_screen_window_manager_changed (GDK_SCREEN (screen_x11)); } + + XFree (xwindow); } /** |