]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
mpipe: clean up decode thread local storage
authorVictor Julien <victor@inliniac.net>
Fri, 28 Mar 2014 12:07:43 +0000 (13:07 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 2 Apr 2014 11:13:52 +0000 (13:13 +0200)
Clean up the thread local data the decode portion of mpipe uses.

Bug #978

src/source-mpipe.c

index 462b74e6dd0e86a53be3fd2fa206f28914e9806e..0574f180071340d27f4d04013d9eef31b2b3ba91 100644 (file)
@@ -128,6 +128,7 @@ TmEcode ReceiveMpipeThreadInit(ThreadVars *, void *, void **);
 void ReceiveMpipeThreadExitStats(ThreadVars *, void *);
 
 TmEcode DecodeMpipeThreadInit(ThreadVars *, void *, void **);
+TmEcode DecodeMpipeThreadDeinit(ThreadVars *tv, void *data);
 TmEcode DecodeMpipe(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *);
 static int MpipeReceiveOpenIqueue(int rank);
 
@@ -191,7 +192,7 @@ void TmModuleDecodeMpipeRegister (void)
     tmm_modules[TMM_DECODEMPIPE].ThreadInit = DecodeMpipeThreadInit;
     tmm_modules[TMM_DECODEMPIPE].Func = DecodeMpipe;
     tmm_modules[TMM_DECODEMPIPE].ThreadExitPrintStats = NULL;
-    tmm_modules[TMM_DECODEMPIPE].ThreadDeinit = NULL;
+    tmm_modules[TMM_DECODEMPIPE].ThreadDeinit = DecodeMpipeThreadDeinit;
     tmm_modules[TMM_DECODEMPIPE].RegisterTests = NULL;
     tmm_modules[TMM_DECODEMPIPE].cap_flags = 0;
     tmm_modules[TMM_DECODEMPIPE].flags = TM_FLAG_DECODE_TM;
@@ -1024,6 +1025,13 @@ TmEcode DecodeMpipeThreadInit(ThreadVars *tv, void *initdata, void **data)
     SCReturnInt(TM_ECODE_OK);
 }
 
+TmEcode DecodeMpipeThreadDeinit(ThreadVars *tv, void *data)
+{
+    if (data != NULL)
+        DecodeThreadVarsFree(data);
+    SCReturnInt(TM_ECODE_OK);
+}
+
 TmEcode DecodeMpipe(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, 
                     PacketQueue *postq)
 {