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);