From eca1a8d73a6a42a2ed4eede4349c386dce9a151e Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 25 Sep 2013 10:21:17 +0200 Subject: [PATCH] profiling: don't alloc 0 bytes block if no rules are used --- src/util-profiling-rules.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util-profiling-rules.c b/src/util-profiling-rules.c index 570805f22a..c3e6c0a235 100644 --- a/src/util-profiling-rules.c +++ b/src/util-profiling-rules.c @@ -477,7 +477,7 @@ void SCProfilingRuleDestroyCtx(SCProfileDetectCtx *ctx) { } void SCProfilingRuleThreadSetup(SCProfileDetectCtx *ctx, DetectEngineThreadCtx *det_ctx) { - if (ctx == NULL) + if (ctx == NULL|| ctx->size == 0) return; SCProfileData *a = SCMalloc(sizeof(SCProfileData) * ctx->size);