Free compressed map when failed to connect client

This commit is contained in:
Michał Janiszewski committed 2016-08-03 07:39:55 +02:00
1 parent 3f07e5929d
commit e930a09f0b
1 file changed
+1
+1
View File
@@ -1026,6 +1026,7 @@ void Network::Server_Send_MAP(NetworkConnection* connection)
log_error("Failed to allocate %u bytes.", header_len + out_size);
connection->SetLastDisconnectReason(STR_MULTIPLAYER_CONNECTION_CLOSED);
connection->Socket->Disconnect();
free(compressed);
return;
}
memcpy(&header[header_len], compressed, out_size);