diff --git a/fvwm/add_window.c b/fvwm/add_window.c index 0acafbf6e..e3f71010d 100644 --- a/fvwm/add_window.c +++ b/fvwm/add_window.c @@ -2599,12 +2599,12 @@ FvwmWindow *AddWindow( } { unsigned int nchildren; - Window parent, *children; + Window parent, *children = NULL; Status rc; rc = XQueryTree( dpy, w, &JunkRoot, &parent, &children, &nchildren); - if (nchildren > 0) + if (nchildren > 0 && children != NULL) { XFree(children); }