diff options
author | eihrul <eihrul> | 2010-05-05 23:37:06 +0000 |
---|---|---|
committer | eihrul <eihrul> | 2010-05-05 23:37:06 +0000 |
commit | 41ccbd2f3f5fca4e427aa99c3b06a573eabb7853 (patch) | |
tree | 1762799b162cd88ba95c534115d2535e4d57b0a1 /packet.c | |
parent | 2be268a77bee17ae7bf47ffbcbb4f4d68d81608d (diff) | |
download | enet-41ccbd2f3f5fca4e427aa99c3b06a573eabb7853.tar.gz enet-41ccbd2f3f5fca4e427aa99c3b06a573eabb7853.zip |
propagate malloc failure
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |