Free state.children in all cases. (#313862, Kjartan Maraas)

2005-08-29  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkasync.c (_gdk_x11_get_window_child_info): Free
	state.children in all cases.  (#313862, Kjartan Maraas)
This commit is contained in:
Matthias Clasen
2005-08-29 04:38:52 +00:00
committed by Matthias Clasen
parent 26aaa97b22
commit d5a3a61c01
3 changed files with 18 additions and 1 deletions

View File

@ -626,6 +626,9 @@ _gdk_x11_get_window_child_info (GdkDisplay *display,
else
wm_state_atom = None;
state.children = NULL;
state.nchildren = 0;
gdk_error_trap_push ();
result = list_children_and_wm_state (dpy, window,
win_has_wm_state ? wm_state_atom : None,
@ -633,12 +636,16 @@ _gdk_x11_get_window_child_info (GdkDisplay *display,
&state.children, &state.nchildren);
gdk_error_trap_pop ();
if (!result)
return FALSE;
{
g_free (state.children);
return FALSE;
}
if (has_wm_state)
{
if (win_has_wm_state)
*win_has_wm_state = TRUE;
g_free (state.children);
return TRUE;
}
else