diff --git a/src/detect-engine.c b/src/detect-engine.c index 634f0aec7b..13c65fe171 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -227,8 +227,9 @@ static void *DetectEngineLiveRuleSwap(void *arg) } + SCLogDebug("swapping new det_ctx - %p with older one - %p", det_ctx, + SC_ATOMIC_GET(slots->slot_data)); SC_ATOMIC_SET(slots->slot_data, det_ctx); - SCLogDebug("swapping new det_ctx with older one"); slots = slots->slot_next; } @@ -418,6 +419,10 @@ void DetectEngineCtxFree(DetectEngineCtx *de_ctx) { SigGroupCleanup(de_ctx); + if (de_ctx->sgh_mpm_context == ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE) { + MpmFactoryDeRegisterAllMpmCtxProfiles(de_ctx); + } + SCFree(de_ctx); //DetectAddressGroupPrintMemory(); //DetectSigGroupPrintMemory(); diff --git a/src/suricata.c b/src/suricata.c index 8c4586db8f..828e40ebd8 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -1926,10 +1926,6 @@ int main(int argc, char **argv) "shutdown phase just before the call to SigGroupCleanup()"); } } -#endif - /* updated by AS. Don't clean up de_ctx. Necessiated by live rule swap */ -#if 0 - SigGroupCleanup(de_ctx); #endif #ifdef __SC_CUDA_SUPPORT__ if (PatternMatchDefaultMatcher() == MPM_B2G_CUDA) { @@ -1945,13 +1941,6 @@ int main(int argc, char **argv) AppLayerHtpPrintStats(); - /* updated by AS. Don't clean up de_ctx. Necessiated by live rule swap */ -#if 0 - SigCleanSignatures(de_ctx); -#endif - if (de_ctx->sgh_mpm_context == ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE) { - MpmFactoryDeRegisterAllMpmCtxProfiles(de_ctx); - } /* updated by AS. Don't clean up de_ctx. Necessiated by live rule swap */ #if 0 DetectEngineCtxFree(de_ctx);