From ab503873caa771ca2aa9e0c7e4c5fbc5a6498280 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 28 Mar 2014 13:14:38 +0100 Subject: [PATCH] erf-file: clean up decode thread local storage Clean up the thread local data the decode portion of ERF users. Bug #978 --- src/source-erf-file.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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. *