aboutsummaryrefslogtreecommitdiffhomepage
path: root/packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/packet.c b/packet.c
index 7f18e49..2fc9a10 100644
--- a/packet.c
+++ b/packet.c
@@ -20,6 +20,8 @@ ENetPacket *
enet_packet_create (const void * data, size_t dataLength, enet_uint32 flags)
{
ENetPacket * packet = (ENetPacket *) enet_malloc (sizeof (ENetPacket));
+ if (packet == NULL)
+ return NULL;
if (flags & ENET_PACKET_FLAG_NO_ALLOCATE)
packet -> data = (enet_uint8 *) data;