tearing: fix UAF on destroy

Fixes: 9a1c411abd
(cherry picked from commit 32e5e5232d)
This commit is contained in:
Kirill Primak 2024-08-07 15:27:02 +03:00 committed by Simon Ser
parent fa4912b1f9
commit 04943bc6ac

View file

@ -29,6 +29,8 @@ static void handle_tearing_controller_destroy(struct wl_listener *listener,
void *data) {
struct sway_tearing_controller *controller =
wl_container_of(listener, controller, destroy);
wl_list_remove(&controller->set_hint.link);
wl_list_remove(&controller->destroy.link);
wl_list_remove(&controller->link);
free(controller);
}