]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
DetectEngineCtxFree() cleanup, also in main
authorAnoop Saldanha <poonaatsoc@gmail.com>
Fri, 22 Jun 2012 18:26:11 +0000 (23:56 +0530)
committerVictor Julien <victor@inliniac.net>
Tue, 26 Jun 2012 07:36:11 +0000 (09:36 +0200)
src/detect-engine.c
src/suricata.c

index 634f0aec7bab9a67b86b1358655f0dd71449e609..13c65fe1714751619a53d214838e239452412fdc 100644 (file)
@@ -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();
index 8c4586db8f5b8187a41fd70aa64cfd27e6a8515b..828e40ebd87d93c9163e7ed7d18a976a04698231 100644 (file)
@@ -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);