emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/xfns.c


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/src/xfns.c
Date: Thu, 14 Mar 2002 04:13:29 -0500

Index: emacs/src/xfns.c
diff -c emacs/src/xfns.c:1.540 emacs/src/xfns.c:1.541
*** emacs/src/xfns.c:1.540      Sun Mar  3 15:07:42 2002
--- emacs/src/xfns.c    Thu Mar 14 04:13:28 2002
***************
*** 1176,1187 ****
        Window wm_window, rootw;
        Window *tmp_children;
        unsigned int tmp_nchildren;
  
!       XQueryTree (FRAME_X_DISPLAY (f), win, &rootw,
!                   &wm_window, &tmp_children, &tmp_nchildren);
!       XFree ((char *) tmp_children);
  
        had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
  
        if (wm_window == rootw || had_errors)
          break;
--- 1176,1193 ----
        Window wm_window, rootw;
        Window *tmp_children;
        unsigned int tmp_nchildren;
+       int success;
  
!       success = XQueryTree (FRAME_X_DISPLAY (f), win, &rootw,
!                           &wm_window, &tmp_children, &tmp_nchildren);
  
        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)
          break;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]