Free 'gameresult', 'gameresult->players', and 'gameresult->heroes' before returning NULL in anongame_gameresult_parse()

This commit is contained in:
relesgoe 2020-09-15 15:12:46 -07:00
parent 94aaa0c928
commit 0ef29ae7bf

View file

@ -113,6 +113,9 @@ namespace pvpgn
if (packet_get_size(packet) < expectedsize + sizeof(t_client_w3route_gameresult_hero)*heroes_count)
{
eventlog(eventlog_level_error, __FUNCTION__, "gameresult packet is smaller than expected");
xfree(gameresult->heroes);
xfree(gameresult->players);
xfree(gameresult);
return NULL;
}