From 29c8125758133ad99971fa4d8f40ea2b931d8620 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 20 Apr 2017 09:32:01 +0200 Subject: [PATCH] redis: use SCCalloc to reduce risk of unitialized vars --- src/util-log-redis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util-log-redis.c b/src/util-log-redis.c index 50d33a90f3..07a4b74e76 100644 --- a/src/util-log-redis.c +++ b/src/util-log-redis.c @@ -55,7 +55,7 @@ void SCLogRedisInit() */ static SCLogRedisContext * SCLogRedisContextAlloc() { - SCLogRedisContext* ctx = (SCLogRedisContext*) SCMalloc(sizeof(SCLogRedisContext)); + SCLogRedisContext* ctx = (SCLogRedisContext*) SCCalloc(1, sizeof(SCLogRedisContext)); if (ctx == NULL) { SCLogError(SC_ERR_MEM_ALLOC, "Unable to allocate redis context"); exit(EXIT_FAILURE); @@ -80,7 +80,7 @@ static int SCConfLogReopenAsyncRedis(LogFileCtx *log_ctx); */ static SCLogRedisContext * SCLogRedisContextAsyncAlloc() { - SCLogRedisContext* ctx = (SCLogRedisContext*) SCMalloc(sizeof(SCLogRedisContext)); + SCLogRedisContext* ctx = (SCLogRedisContext*) SCCalloc(1, sizeof(SCLogRedisContext)); if (unlikely(ctx == NULL)) { SCLogError(SC_ERR_MEM_ALLOC, "Unable to allocate redis context"); exit(EXIT_FAILURE);