From a60fab80e6c3bb371d9ccc32a726c3247d9ff98d Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Thu, 13 Jan 2022 23:46:43 +0100 Subject: [PATCH] c/main: Don't leak non_desktop_reply --- src/xrt/compositor/main/comp_window_direct_randr.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xrt/compositor/main/comp_window_direct_randr.c b/src/xrt/compositor/main/comp_window_direct_randr.c index 489a90391..7a6a75ae0 100644 --- a/src/xrt/compositor/main/comp_window_direct_randr.c +++ b/src/xrt/compositor/main/comp_window_direct_randr.c @@ -374,6 +374,7 @@ comp_window_direct_randr_get_outputs(struct comp_window_direct_randr *w) xcb_intern_atom_reply_t *non_desktop_reply = xcb_intern_atom_reply(connection, non_desktop_cookie, &error); if (error != NULL) { + free(non_desktop_reply); COMP_ERROR(ct->c, "xcb_intern_atom_reply returned error %d", error->error_code); return; } @@ -384,6 +385,7 @@ comp_window_direct_randr_get_outputs(struct comp_window_direct_randr *w) } if (non_desktop_reply->atom == XCB_NONE) { + free(non_desktop_reply); COMP_ERROR(ct->c, "No output has non-desktop property"); return; } @@ -447,5 +449,6 @@ comp_window_direct_randr_get_outputs(struct comp_window_direct_randr *w) free(output_reply); } + free(non_desktop_reply); free(resources_reply); }