From a3ed1d2590c2acd041dfc9a783daa240fddfc11d Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 26 Mar 2022 19:38:30 +0800 Subject: [PATCH] ; * 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 9d66181de40..fb201f85065 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) -- 2.39.2