tearing: fix UAF on destroy

Fixes: 9a1c411abd
This commit is contained in:
Kirill Primak 2024-08-07 15:27:02 +03:00
parent cf4ebad642
commit f69041e620

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);
}