Avoid crash in case of ENENT_..._NONE messages (which typically

don't have packet data).


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/hilnius@13189 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2013-07-11 22:41:56 +00:00
parent d0059d32d4
commit 706c231691

View File

@ -37,7 +37,10 @@ Event::Event(ENetEvent* event)
type = EVENT_TYPE_MESSAGE;
break;
case ENET_EVENT_TYPE_NONE:
enet_packet_destroy(event->packet);
// Typically there's no packet data, but just in
// case test and delete it
if(event->packet)
enet_packet_destroy(event->packet);
return;
break;
}