From: Victor Julien Date: Fri, 28 Mar 2014 12:02:31 +0000 (+0100) Subject: napatech: clean up decode thread local storage X-Git-Tag: suricata-2.0.1rc1~75 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=10c791c937734cc447dc21d93608de9567a7665c;p=thirdparty%2Fsuricata.git napatech: clean up decode thread local storage Clean up the thread local data the decode portion of napatech uses. Bug #978 --- diff --git a/src/source-napatech.c b/src/source-napatech.c index 032510b517..76e1069fc8 100644 --- a/src/source-napatech.c +++ b/src/source-napatech.c @@ -97,6 +97,7 @@ void NapatechStreamThreadExitStats(ThreadVars *, void *); TmEcode NapatechStreamLoop(ThreadVars *tv, void *data, void *slot); TmEcode NapatechDecodeThreadInit(ThreadVars *, void *, void **); +TmEcode NapatechDecodeThreadDeinit(ThreadVars *tv, void *data); TmEcode NapatechDecode(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *); /** @@ -124,7 +125,7 @@ void TmModuleNapatechDecodeRegister(void) tmm_modules[TMM_DECODENAPATECH].ThreadInit = NapatechDecodeThreadInit; tmm_modules[TMM_DECODENAPATECH].Func = NapatechDecode; tmm_modules[TMM_DECODENAPATECH].ThreadExitPrintStats = NULL; - tmm_modules[TMM_DECODENAPATECH].ThreadDeinit = NULL; + tmm_modules[TMM_DECODENAPATECH].ThreadDeinit = NapatechDecodeThreadDeinit; tmm_modules[TMM_DECODENAPATECH].RegisterTests = NULL; tmm_modules[TMM_DECODENAPATECH].cap_flags = 0; tmm_modules[TMM_DECODENAPATECH].flags = TM_FLAG_DECODE_TM; @@ -400,4 +401,11 @@ TmEcode NapatechDecodeThreadInit(ThreadVars *tv, void *initdata, void **data) SCReturnInt(TM_ECODE_OK); } +TmEcode NapatechDecodeThreadDeinit(ThreadVars *tv, void *data) +{ + if (data != NULL) + DecodeThreadVarsFree(data); + SCReturnInt(TM_ECODE_OK); +} + #endif /* HAVE_NAPATECH */