Browse Source

[WebSocket] Fix potential double free after multiplayer clear.

Fabio Alessandrelli 2 years ago
parent
commit
0fe01b6b4a
1 changed files with 1 additions and 0 deletions
  1. 1 0
      modules/websocket/websocket_multiplayer_peer.cpp

+ 1 - 0
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) {