From: Victor Julien Date: Fri, 28 Mar 2014 12:05:40 +0000 (+0100) Subject: ipfw: clean up decode thread local storage X-Git-Tag: suricata-2.0.1rc1~74 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c16fede088f8c374118f3bf6d1c91a4348325c0;p=thirdparty%2Fsuricata.git ipfw: clean up decode thread local storage Clean up the thread local data the decode portion of ipfw uses. Bug #978 --- diff --git a/src/source-ipfw.c b/src/source-ipfw.c index cfe24bf94a..e152b69ca5 100644 --- a/src/source-ipfw.c +++ b/src/source-ipfw.c @@ -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 *