summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoreihrul <eihrul>2011-12-08 14:20:54 +0000
committereihrul <eihrul>2011-12-08 14:20:54 +0000
commite96c668702e118ad4377503fb9755eaaeca1785c (patch)
treed0a03e8f980413073480dfd80e3cbac79e3523d7
parentd4768414eba8ccdab6c654262fdbf8081adca5a7 (diff)
downloadenet-e96c668702e118ad4377503fb9755eaaeca1785c.tar.gz
enet-e96c668702e118ad4377503fb9755eaaeca1785c.zip
zero out host memory on creation
-rw-r--r--host.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/host.c b/host.c
index c44f2ed..0bca71c 100644
--- a/host.c
+++ b/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)