From e03120c94479d78bad15a765c7b86602cd7efd6d Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Fri, 29 Dec 2023 17:34:48 +0100 Subject: [PATCH] [web] Fix possible invalid read during shutdown The player may emit a listener event when shutting down, and since websockets didn't remove it's listener callback it would receive an event despite being deinitialized. This would lead to an invalid read by lws_cancel_service in listener_cb(). --- src/websocket.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/websocket.c b/src/websocket.c index 2c5ad80ed6..071bafd2c1 100644 --- a/src/websocket.c +++ b/src/websocket.c @@ -429,6 +429,8 @@ websocket(void *arg) #endif } + listener_remove(listener_cb); + pthread_exit(NULL); }