From: Victor Julien Date: Wed, 25 Sep 2013 08:21:17 +0000 (+0200) Subject: profiling: don't alloc 0 bytes block if no rules are used X-Git-Tag: suricata-2.0beta2~329 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eca1a8d73a6a42a2ed4eede4349c386dce9a151e;p=thirdparty%2Fsuricata.git profiling: don't alloc 0 bytes block if no rules are used --- 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);