From: Victor Julien Date: Fri, 28 Mar 2014 12:14:38 +0000 (+0100) Subject: erf-file: clean up decode thread local storage X-Git-Tag: suricata-2.0.1rc1~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab503873caa771ca2aa9e0c7e4c5fbc5a6498280;p=thirdparty%2Fsuricata.git erf-file: clean up decode thread local storage Clean up the thread local data the decode portion of ERF users. Bug #978 --- diff --git a/src/source-erf-file.c b/src/source-erf-file.c index 23a719f1b1..53ffee1df9 100644 --- a/src/source-erf-file.c +++ b/src/source-erf-file.c @@ -68,6 +68,7 @@ void ReceiveErfFileThreadExitStats(ThreadVars *, void *); TmEcode ReceiveErfFileThreadDeinit(ThreadVars *, void *); TmEcode DecodeErfFileThreadInit(ThreadVars *, void *, void **); +TmEcode DecodeErfFileThreadDeinit(ThreadVars *tv, void *data); TmEcode DecodeErfFile(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *); /** @@ -98,7 +99,7 @@ TmModuleDecodeErfFileRegister(void) tmm_modules[TMM_DECODEERFFILE].ThreadInit = DecodeErfFileThreadInit; tmm_modules[TMM_DECODEERFFILE].Func = DecodeErfFile; tmm_modules[TMM_DECODEERFFILE].ThreadExitPrintStats = NULL; - tmm_modules[TMM_DECODEERFFILE].ThreadDeinit = NULL; + tmm_modules[TMM_DECODEERFFILE].ThreadDeinit = DecodeErfFileThreadDeinit; tmm_modules[TMM_DECODEERFFILE].RegisterTests = NULL; tmm_modules[TMM_DECODEERFFILE].cap_flags = 0; tmm_modules[TMM_DECODEERFFILE].flags = TM_FLAG_DECODE_TM; @@ -264,6 +265,13 @@ DecodeErfFileThreadInit(ThreadVars *tv, void *initdata, void **data) SCReturnInt(TM_ECODE_OK); } +TmEcode DecodeErfFileThreadDeinit(ThreadVars *tv, void *data) +{ + if (data != NULL) + DecodeThreadVarsFree(data); + SCReturnInt(TM_ECODE_OK); +} + /** * \brief Decode the ERF file. *