Use Memory_safeCalloc() to allocate zeroed memory.
[umurmur.git] / src / ban.c
index 7028ea6f5dd597bd60f3c3e27d7293202d87e3f8..84e95dc174e7a3ed881b616a70f4a75d39f573b6 100644 (file)
--- a/src/ban.c
+++ b/src/ban.c
@@ -351,8 +351,7 @@ static void Ban_readBanFile(void)
                if (p == NULL) break;
                reason = p;
 
-               ban = Memory_safeMalloc(1, sizeof(ban_t));
-               memset(ban, 0, sizeof(ban_t));
+               ban = Memory_safeCalloc(1, sizeof(ban_t));
                SSLi_hex2hash(hexhash, ban->hash);
                if (inet_pton(AF_INET, address, &ban->address) == 0) {
                        if (inet_pton(AF_INET6, address, &ban->address) == 0) {