emacs-diffs
[Top][All Lists]
Advanced

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

master a3ed1d2590: ; * src/xterm.c (x_dnd_compute_toplevels): Fix cookie


From: Po Lu
Subject: master a3ed1d2590: ; * src/xterm.c (x_dnd_compute_toplevels): Fix cookie leak if rc is 0.
Date: Sat, 26 Mar 2022 07:39:03 -0400 (EDT)

branch: master
commit a3ed1d2590c2acd041dfc9a783daa240fddfc11d
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    ; * src/xterm.c (x_dnd_compute_toplevels): Fix cookie leak if rc is 0.
---
 src/xterm.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/src/xterm.c b/src/xterm.c
index 9d66181de4..fb201f8506 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1288,6 +1288,39 @@ x_dnd_compute_toplevels (struct x_display_info *dpyinfo)
 
          x_dnd_toplevels = tem;
        }
+      else
+       {
+#ifdef HAVE_XCB_SHAPE
+         if (dpyinfo->xshape_supported_p)
+           {
+             bounding_rect_reply = xcb_shape_get_rectangles_reply 
(dpyinfo->xcb_connection,
+                                                                   
bounding_rect_cookies[i],
+                                                                   &error);
+
+             if (bounding_rect_reply)
+               free (bounding_rect_reply);
+             else
+               free (error);
+           }
+#endif
+
+#ifdef HAVE_XCB_SHAPE_INPUT_RECTS
+         if (dpyinfo->xshape_supported_p
+             && (dpyinfo->xshape_major > 1
+                 || (dpyinfo->xshape_major == 1
+                     && dpyinfo->xshape_minor >= 1)))
+           {
+             input_rect_reply = xcb_shape_get_rectangles_reply 
(dpyinfo->xcb_connection,
+                                                                   
input_rect_cookies[i],
+                                                                   &error);
+
+             if (input_rect_reply)
+               free (input_rect_reply);
+             else
+               free (error);
+           }
+#endif
+       }
 
 #ifdef USE_XCB
       if (attrs_reply)



reply via email to

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