Fixed memory leak (thanks to CruzR).

This commit is contained in:
hiker 2015-11-02 10:55:17 +11:00
parent 7c51be7724
commit 6946306c4c

View File

@ -166,7 +166,7 @@ uint8_t* Network::receiveRawPacket(TransportAddress* sender)
* matching the sender's ip address.
*/
uint8_t* Network::receiveRawPacket(const TransportAddress& sender,
int max_tries)
int max_tries)
{
const int LEN = 2048;
uint8_t* buffer = new uint8_t[LEN];
@ -197,6 +197,7 @@ uint8_t* Network::receiveRawPacket(const TransportAddress& sender,
TransportAddress a(m_host->address);
Log::verbose("STKHost", "No answer from the server on %s",
a.toString().c_str());
delete [] buffer;
return NULL;
}
}