[Oisf-devel] [PATCH 7/7] Free MPm struct in UTHFreePackets to avoid crash

Eric Leblond eric at regit.org
Mon Jan 31 22:45:41 UTC 2011


When running suricata unittests with the default configuration file,
there is a crash in IPOnlyTestSig?? tests which is linked with the
fact that the MpmCtxProfile are not correctly reinitialised between
the unittests.
This patch adds a call to MpmFactoryDeRegisterAllMpmCtxProfiles in
UTHFreePackets. This fixes the unittest crash by restoring a standard
usage case.
---
 src/util-unittest-helper.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/util-unittest-helper.c b/src/util-unittest-helper.c
index f7fbe01..5c99247 100644
--- a/src/util-unittest-helper.c
+++ b/src/util-unittest-helper.c
@@ -355,6 +355,8 @@ void UTHFreePackets(Packet **p, int numpkts) {
     for (; i < numpkts; i++) {
         UTHFreePacket(p[i]);
     }
+
+    MpmFactoryDeRegisterAllMpmCtxProfiles();
 }
 
 /**
-- 
1.7.1




More information about the Oisf-devel mailing list