Commit e7161ad9 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(x_real_positions): Handle failure in XQueryTree.

parent 7c3f9166
...@@ -1176,13 +1176,19 @@ x_real_positions (f, xptr, yptr) ...@@ -1176,13 +1176,19 @@ x_real_positions (f, xptr, yptr)
Window wm_window, rootw; Window wm_window, rootw;
Window *tmp_children; Window *tmp_children;
unsigned int tmp_nchildren; unsigned int tmp_nchildren;
int success;
XQueryTree (FRAME_X_DISPLAY (f), win, &rootw, success = XQueryTree (FRAME_X_DISPLAY (f), win, &rootw,
&wm_window, &tmp_children, &tmp_nchildren); &wm_window, &tmp_children, &tmp_nchildren);
XFree ((char *) tmp_children);
had_errors = x_had_errors_p (FRAME_X_DISPLAY (f)); had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
/* Don't free tmp_children if XQueryTree failed. */
if (! success)
break;
XFree ((char *) tmp_children);
if (wm_window == rootw || had_errors) if (wm_window == rootw || had_errors)
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment