From: Victor Julien Date: Fri, 28 Mar 2014 12:11:03 +0000 (+0100) Subject: endace-dag: clean up decode thread local storage X-Git-Tag: suricata-2.0.1rc1~72 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6da8652a7796d0013e7667d29674e0d617f09938;p=thirdparty%2Fsuricata.git endace-dag: clean up decode thread local storage Clean up the thread local data the decode portion of DAG uses. Bug #978 --- 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 */