From cdeeb881a01edb46c998c98a774e6b414c753446 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Mon, 31 May 2021 19:17:24 +0300 Subject: [PATCH] xwayland/window-manager: Handle weston_wm_window's name/class destruction Memleak found by ASAN: Direct leak of 21 byte(s) in 1 object(s) allocated from: #0 0x7fe7a917fe8f in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.6+0xa9e8f) #1 0x7fe7a9129874 (/usr/lib/x86_64-linux-gnu/libasan.so.6+0x53874) #2 0x7fe7a5a23469 in weston_wm_window_read_properties ../xwayland/window-manager.c:574 #3 0x7fe7a5a28d3b in weston_wm_handle_map_request ../xwayland/window-manager.c:1178 #4 0x7fe7a5a31660 in weston_wm_handle_event ../xwayland/window-manager.c:2291 #5 0x7fe7a8c261a1 in wl_event_loop_dispatch ../src/event-loop.c:1027 Signed-off-by: Marius Vlad --- xwayland/window-manager.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index c17b53c5..a680cdd1 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -1555,6 +1555,10 @@ weston_wm_window_destroy(struct weston_wm_window *window) if (window->surface) wl_list_remove(&window->surface_destroy_listener.link); + free(window->class); + free(window->name); + free(window->machine); + hash_table_remove(window->wm->window_hash, window->id); free(window); }