diff options
-rw-r--r-- | generic/tkZinc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c index 00b2e35..135ddb2 100644 --- a/generic/tkZinc.c +++ b/generic/tkZinc.c @@ -7070,23 +7070,23 @@ Event(ClientData client_data, /* Information about widget. */ * Set the real top window above us. */ { - Window parent, root, *children; + Window parent, root, *children=NULL; Tk_Window top_level; - int num_children; + int num_children, success; top_level = wi->win; while (!Tk_IsTopLevel(top_level)) { top_level = Tk_Parent(top_level); } - XQueryTree(wi->dpy, Tk_WindowId(top_level), &root, &parent, - &children, &num_children); + success = XQueryTree(wi->dpy, Tk_WindowId(top_level), &root, &parent, + &children, &num_children); if (root == parent) { wi->real_top = Tk_WindowId(top_level); } else { wi->real_top = parent; } - if (children) { + if (children && success) { XFree(children); } } |