mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 06:25:59 -07:00
zero out host memory on creation
This commit is contained in:
parent
d4768414eb
commit
e96c668702
1 changed files with 1 additions and 0 deletions
1
host.c
1
host.c
|
@ -38,6 +38,7 @@ enet_host_create (const ENetAddress * address, size_t peerCount, size_t channelL
|
|||
host = (ENetHost *) enet_malloc (sizeof (ENetHost));
|
||||
if (host == NULL)
|
||||
return NULL;
|
||||
memset (host, 0, sizeof (ENetHost));
|
||||
|
||||
host -> peers = (ENetPeer *) enet_malloc (peerCount * sizeof (ENetPeer));
|
||||
if (host -> peers == NULL)
|
||||
|
|
Loading…
Reference in a new issue