DetectEngineCtxFree() cleanup, also in main

remotes/origin/master
Anoop Saldanha 14 years ago committed by Victor Julien
parent c3eab5cf4e
commit eee33866df

@ -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); SC_ATOMIC_SET(slots->slot_data, det_ctx);
SCLogDebug("swapping new det_ctx with older one");
slots = slots->slot_next; slots = slots->slot_next;
} }
@ -418,6 +419,10 @@ void DetectEngineCtxFree(DetectEngineCtx *de_ctx) {
SigGroupCleanup(de_ctx); SigGroupCleanup(de_ctx);
if (de_ctx->sgh_mpm_context == ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE) {
MpmFactoryDeRegisterAllMpmCtxProfiles(de_ctx);
}
SCFree(de_ctx); SCFree(de_ctx);
//DetectAddressGroupPrintMemory(); //DetectAddressGroupPrintMemory();
//DetectSigGroupPrintMemory(); //DetectSigGroupPrintMemory();

@ -1926,10 +1926,6 @@ int main(int argc, char **argv)
"shutdown phase just before the call to SigGroupCleanup()"); "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 #endif
#ifdef __SC_CUDA_SUPPORT__ #ifdef __SC_CUDA_SUPPORT__
if (PatternMatchDefaultMatcher() == MPM_B2G_CUDA) { if (PatternMatchDefaultMatcher() == MPM_B2G_CUDA) {
@ -1945,13 +1941,6 @@ int main(int argc, char **argv)
AppLayerHtpPrintStats(); 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 */ /* updated by AS. Don't clean up de_ctx. Necessiated by live rule swap */
#if 0 #if 0
DetectEngineCtxFree(de_ctx); DetectEngineCtxFree(de_ctx);

Loading…
Cancel
Save