From e96c668702e118ad4377503fb9755eaaeca1785c Mon Sep 17 00:00:00 2001 From: eihrul Date: Thu, 8 Dec 2011 14:20:54 +0000 Subject: [PATCH] zero out host memory on creation --- host.c | 1 + 1 file changed, 1 insertion(+) 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)