From 71b75500495d5e11ba5fbe937e421b349d3d3059 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 11 Sep 2012 02:28:50 +0300 Subject: treat destroying NULL as no-op --- packet.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packet.c') diff --git a/packet.c b/packet.c index fd59b14..3adb287 100644 --- a/packet.c +++ b/packet.c @@ -55,6 +55,9 @@ enet_packet_create (const void * data, size_t dataLength, enet_uint32 flags) void enet_packet_destroy (ENetPacket * packet) { + if (packet == NULL) + return; + if (packet -> freeCallback != NULL) (* packet -> freeCallback) (packet); if (! (packet -> flags & ENET_PACKET_FLAG_NO_ALLOCATE) && -- cgit v1.2.3