From 0fe01b6b4a3ddcc1acf3f1a01e1529328a6569d7 Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 13 Oct 2022 18:04:12 +0200 Subject: [PATCH] [WebSocket] Fix potential double free after multiplayer clear. --- modules/websocket/websocket_multiplayer_peer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/websocket/websocket_multiplayer_peer.cpp b/modules/websocket/websocket_multiplayer_peer.cpp index 00b96ec5872..c314ebd0490 100644 --- a/modules/websocket/websocket_multiplayer_peer.cpp +++ b/modules/websocket/websocket_multiplayer_peer.cpp @@ -61,6 +61,7 @@ void WebSocketMultiplayerPeer::_clear() { tls_key.unref(); if (current_packet.data != nullptr) { memfree(current_packet.data); + current_packet.data = nullptr; } for (Packet &E : incoming_packets) {