Skip to content

Commit

Permalink
xwayland/window-manager: Handle weston_wm_window's name/class destruc…
Browse files Browse the repository at this point in the history
…tion

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 <[email protected]>
  • Loading branch information
Marius Vlad committed Jun 1, 2021
1 parent 4c7dbe6 commit cdeeb88
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xwayland/window-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit cdeeb88

Please sign in to comment.