]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ipfw: clean up decode thread local storage
authorVictor Julien <victor@inliniac.net>
Fri, 28 Mar 2014 12:05:40 +0000 (13:05 +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 ipfw uses.

Bug #978

src/source-ipfw.c

index cfe24bf94a94bdb77279f3c4fa863f0fb66bf5f5..e152b69ca550c3b2b773584382fc6f55a3572af3 100644 (file)
@@ -139,6 +139,7 @@ void VerdictIPFWThreadExitStats(ThreadVars *, void *);
 TmEcode VerdictIPFWThreadDeinit(ThreadVars *, void *);
 
 TmEcode DecodeIPFWThreadInit(ThreadVars *, void *, void **);
+TmEcode DecodeIPFWThreadDeinit(ThreadVars *tv, void *data);
 TmEcode DecodeIPFW(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *);
 
 /**
@@ -185,7 +186,7 @@ void TmModuleDecodeIPFWRegister (void) {
     tmm_modules[TMM_DECODEIPFW].ThreadInit = DecodeIPFWThreadInit;
     tmm_modules[TMM_DECODEIPFW].Func = DecodeIPFW;
     tmm_modules[TMM_DECODEIPFW].ThreadExitPrintStats = NULL;
-    tmm_modules[TMM_DECODEIPFW].ThreadDeinit = NULL;
+    tmm_modules[TMM_DECODEIPFW].ThreadDeinit = DecodeIPFWThreadDeinit;
     tmm_modules[TMM_DECODEIPFW].RegisterTests = NULL;
     tmm_modules[TMM_DECODEIPFW].flags = TM_FLAG_DECODE_TM;
 }
@@ -498,6 +499,13 @@ TmEcode DecodeIPFWThreadInit(ThreadVars *tv, void *initdata, void **data)
     SCReturnInt(TM_ECODE_OK);
 }
 
+TmEcode DecodeIPFWThreadDeinit(ThreadVars *tv, void *data)
+{
+    if (data != NULL)
+        DecodeThreadVarsFree(data);
+    SCReturnInt(TM_ECODE_OK);
+}
+
 /**
  * \brief This function sets the Verdict and processes the packet
  *