Преглед на файлове

zero out host memory on creation

eihrul преди 13 години
родител
ревизия
e96c668702
променени са 1 файла, в които са добавени 1 реда и са изтрити 0 реда
  1. 1 0
      host.c

+ 1 - 0
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)