summaryrefslogtreecommitdiff
path: root/source/smbd/mangle_hash2.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/smbd/mangle_hash2.c')
-rw-r--r--source/smbd/mangle_hash2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/smbd/mangle_hash2.c b/source/smbd/mangle_hash2.c
index a48981dddd4..447118a6b1a 100644
--- a/source/smbd/mangle_hash2.c
+++ b/source/smbd/mangle_hash2.c
@@ -141,14 +141,12 @@ static BOOL cache_init(void)
{
if (prefix_cache) return True;
- prefix_cache = malloc(sizeof(char *) * MANGLE_CACHE_SIZE);
+ prefix_cache = calloc(MANGLE_CACHE_SIZE, sizeof(char *));
if (!prefix_cache) return False;
- prefix_cache_hashes = malloc(sizeof(u32) * MANGLE_CACHE_SIZE);
+ prefix_cache_hashes = calloc(MANGLE_CACHE_SIZE, sizeof(u32));
if (!prefix_cache_hashes) return False;
- memset(prefix_cache, 0, sizeof(char *) * MANGLE_CACHE_SIZE);
- memset(prefix_cache_hashes, 0, sizeof(char *) * MANGLE_CACHE_SIZE);
return True;
}