aboutsummaryrefslogtreecommitdiffhomepage
path: root/packet.c
diff options
context:
space:
mode:
authoreihrul <eihrul>2010-05-05 23:37:06 +0000
committereihrul <eihrul>2010-05-05 23:37:06 +0000
commit41ccbd2f3f5fca4e427aa99c3b06a573eabb7853 (patch)
tree1762799b162cd88ba95c534115d2535e4d57b0a1 /packet.c
parent2be268a77bee17ae7bf47ffbcbb4f4d68d81608d (diff)
downloadenet-41ccbd2f3f5fca4e427aa99c3b06a573eabb7853.tar.gz
enet-41ccbd2f3f5fca4e427aa99c3b06a573eabb7853.zip
propagate malloc failure
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;