Skip to content

Commit

Permalink
[web] Fix possible invalid read during shutdown
Browse files Browse the repository at this point in the history
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().
  • Loading branch information
ejurgensen committed Dec 29, 2023
1 parent c28d108 commit e03120c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ websocket(void *arg)
#endif
}

listener_remove(listener_cb);

pthread_exit(NULL);
}

Expand Down

0 comments on commit e03120c

Please sign in to comment.