From: Victor Julien Date: Fri, 28 Mar 2014 12:07:43 +0000 (+0100) Subject: mpipe: clean up decode thread local storage X-Git-Tag: suricata-2.0.1rc1~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09ebbe08df005e1045b8d12ea67767f89bd3f564;p=thirdparty%2Fsuricata.git mpipe: clean up decode thread local storage Clean up the thread local data the decode portion of mpipe uses. Bug #978 --- diff --git a/src/source-mpipe.c b/src/source-mpipe.c index 462b74e6dd..0574f18007 100644 --- a/src/source-mpipe.c +++ b/src/source-mpipe.c @@ -128,6 +128,7 @@ TmEcode ReceiveMpipeThreadInit(ThreadVars *, void *, void **); void ReceiveMpipeThreadExitStats(ThreadVars *, void *); TmEcode DecodeMpipeThreadInit(ThreadVars *, void *, void **); +TmEcode DecodeMpipeThreadDeinit(ThreadVars *tv, void *data); TmEcode DecodeMpipe(ThreadVars *, Packet *, void *, PacketQueue *, PacketQueue *); static int MpipeReceiveOpenIqueue(int rank); @@ -191,7 +192,7 @@ void TmModuleDecodeMpipeRegister (void) tmm_modules[TMM_DECODEMPIPE].ThreadInit = DecodeMpipeThreadInit; tmm_modules[TMM_DECODEMPIPE].Func = DecodeMpipe; tmm_modules[TMM_DECODEMPIPE].ThreadExitPrintStats = NULL; - tmm_modules[TMM_DECODEMPIPE].ThreadDeinit = NULL; + tmm_modules[TMM_DECODEMPIPE].ThreadDeinit = DecodeMpipeThreadDeinit; tmm_modules[TMM_DECODEMPIPE].RegisterTests = NULL; tmm_modules[TMM_DECODEMPIPE].cap_flags = 0; tmm_modules[TMM_DECODEMPIPE].flags = TM_FLAG_DECODE_TM; @@ -1024,6 +1025,13 @@ TmEcode DecodeMpipeThreadInit(ThreadVars *tv, void *initdata, void **data) SCReturnInt(TM_ECODE_OK); } +TmEcode DecodeMpipeThreadDeinit(ThreadVars *tv, void *data) +{ + if (data != NULL) + DecodeThreadVarsFree(data); + SCReturnInt(TM_ECODE_OK); +} + TmEcode DecodeMpipe(ThreadVars *tv, Packet *p, void *data, PacketQueue *pq, PacketQueue *postq) {