]> git.eshelyaron.com Git - emacs.git/commitdiff
; * src/xterm.c (x_dnd_compute_toplevels): Fix cookie leak if rc is 0.
authorPo Lu <luangruo@yahoo.com>
Sat, 26 Mar 2022 11:38:30 +0000 (19:38 +0800)
committerPo Lu <luangruo@yahoo.com>
Sat, 26 Mar 2022 11:38:30 +0000 (19:38 +0800)
src/xterm.c

index 9d66181de402afc1055e7b7faae6033951b6eb04..fb201f85065f775e4a3a6e0e1c7518d4b8a6e2c1 100644 (file)
@@ -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)