From: Victor Julien Date: Mon, 25 Jun 2018 09:15:16 +0000 (+0200) Subject: detect/tenants: fix crash when adding mapping X-Git-Tag: suricata-4.1.0-rc1~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4866295bfb07945c863313a4702fd3db05024afe;p=thirdparty%2Fsuricata.git detect/tenants: fix crash when adding mapping When no tenants and mappings are defined in 'live' mode, adding a mapping resulted in a crash. --- diff --git a/src/detect-engine.c b/src/detect-engine.c index 8e61aa9991..22cbb236fc 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -2363,10 +2363,12 @@ static DetectEngineThreadCtx *DetectEngineThreadCtxInitForReload( } /* most of the init happens here */ - if (ThreadCtxDoInit(det_ctx->de_ctx, det_ctx) != TM_ECODE_OK) { - DetectEngineDeReference(&det_ctx->de_ctx); - SCFree(det_ctx); - return NULL; + if (det_ctx->de_ctx->minimal == 0) { + if (ThreadCtxDoInit(det_ctx->de_ctx, det_ctx) != TM_ECODE_OK) { + DetectEngineDeReference(&det_ctx->de_ctx); + SCFree(det_ctx); + return NULL; + } } /** alert counter setup */