From 4866295bfb07945c863313a4702fd3db05024afe Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Mon, 25 Jun 2018 11:15:16 +0200 Subject: [PATCH] detect/tenants: fix crash when adding mapping When no tenants and mappings are defined in 'live' mode, adding a mapping resulted in a crash. --- src/detect-engine.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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 */