From 6da8652a7796d0013e7667d29674e0d617f09938 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 28 Mar 2014 13:11:03 +0100 Subject: [PATCH] endace-dag: clean up decode thread local storage Clean up the thread local data the decode portion of DAG uses. Bug #978 --- src/source-erf-dag.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/source-erf-dag.c b/src/source-erf-dag.c index c6625ace8b..95eaaf5a37 100644 --- a/src/source-erf-dag.c +++ b/src/source-erf-dag.c @@ -105,6 +105,7 @@ void ReceiveErfDagThreadExitStats(ThreadVars *, void *); TmEcode ReceiveErfDagThreadDeinit(ThreadVars *, void *); TmEcode DecodeErfDagThreadInit(ThreadVars *, void *, void **); +TmEcode DecodeErfDagThreadDeinit(ThreadVars *tv, void *data); TmEcode DecodeErfDag(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *); void ReceiveErfDagCloseStream(int dagfd, int stream); @@ -136,7 +137,7 @@ TmModuleDecodeErfDagRegister(void) tmm_modules[TMM_DECODEERFDAG].ThreadInit = DecodeErfDagThreadInit; tmm_modules[TMM_DECODEERFDAG].Func = DecodeErfDag; tmm_modules[TMM_DECODEERFDAG].ThreadExitPrintStats = NULL; - tmm_modules[TMM_DECODEERFDAG].ThreadDeinit = NULL; + tmm_modules[TMM_DECODEERFDAG].ThreadDeinit = DecodeErfDagThreadDeinit; tmm_modules[TMM_DECODEERFDAG].RegisterTests = NULL; tmm_modules[TMM_DECODEERFDAG].cap_flags = 0; tmm_modules[TMM_DECODEERFDAG].flags = TM_FLAG_DECODE_TM; @@ -644,4 +645,11 @@ TmEcode DecodeErfDagThreadInit(ThreadVars *tv, void *initdata, void **data) SCReturnInt(TM_ECODE_OK); } +TmEcode DecodeErfDagThreadDeinit(ThreadVars *tv, void *data) +{ + if (data != NULL) + DecodeThreadVarsFree(data); + SCReturnInt(TM_ECODE_OK); +} + #endif /* HAVE_DAG */