From 3759ad153870de7d3c7680c38fb64165118d5a37 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Wed, 19 Jan 2022 10:40:06 -0600 Subject: [PATCH] tests: Fix use after free on exit We need to unlink this before freeing it since it's being called from weston_signal_emit_mutable. Signed-off-by: Derek Foreman --- tests/weston-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/weston-test.c b/tests/weston-test.c index bf132960..f8db286b 100644 --- a/tests/weston-test.c +++ b/tests/weston-test.c @@ -618,6 +618,8 @@ handle_compositor_destroy(struct wl_listener *listener, test = wl_container_of(listener, test, destroy_listener); + wl_list_remove(&test->destroy_listener.link); + if (test->client_source) { weston_log_scope_printf(test->log, "Cancelling client thread...\n"); pthread_cancel(test->client_thread);