aboutsummaryrefslogtreecommitdiffhomepage
path: root/packet.c
diff options
context:
space:
mode:
authorLee Salzman <[email protected]>2012-09-11 02:28:50 +0300
committerLee Salzman <[email protected]>2012-09-11 02:28:50 +0300
commit71b75500495d5e11ba5fbe937e421b349d3d3059 (patch)
treef135a7f63f295884ac0657aea752f9b36dc1fc30 /packet.c
parentbe852c5d8ba1c4e097cc86d49ddc4998a486c0eb (diff)
downloadenet-71b75500495d5e11ba5fbe937e421b349d3d3059.tar.gz
enet-71b75500495d5e11ba5fbe937e421b349d3d3059.zip
treat destroying NULL as no-op
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c3
1 files changed, 3 insertions, 0 deletions
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) &&