tearing: fix UAF on destroy

Fixes: 9a1c411abd
This commit is contained in:
Kirill Primak 2024-08-07 15:27:02 +03:00 committed by Kenny Levinsen
parent 3e956b9229
commit 32e5e5232d

View file

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