From: Victor Julien Date: Mon, 27 Feb 2017 22:28:46 +0000 (+0100) Subject: detect: only do flow dependent cleanup if a flow is present X-Git-Tag: suricata-4.0.0-beta1~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e1aba7d6c2525b720fd8bdc9c189ef328aaf2113;p=thirdparty%2Fsuricata.git detect: only do flow dependent cleanup if a flow is present --- diff --git a/src/detect.c b/src/detect.c index e5e96d0e22..edce8a1a1b 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1403,10 +1403,6 @@ end: /* cleanup pkt specific part of the patternmatcher */ PacketPatternCleanup(th_v, det_ctx); - DetectEngineCleanHCBDBuffers(det_ctx); - DetectEngineCleanHSBDBuffers(det_ctx); - DetectEngineCleanSMTPBuffers(det_ctx); - /* store the found sgh (or NULL) in the flow to save us from looking it * up again for the next packet. Also return any stream chunk we processed * to the pool. */ @@ -1421,10 +1417,13 @@ end: } /* update inspected tracker for raw reassembly */ - if (p->proto == IPPROTO_TCP && pflow->protoctx != NULL) - { + if (p->proto == IPPROTO_TCP && pflow->protoctx != NULL) { StreamReassembleRawUpdateProgress(pflow->protoctx, p, det_ctx->raw_stream_progress); + + DetectEngineCleanHCBDBuffers(det_ctx); + DetectEngineCleanHSBDBuffers(det_ctx); + DetectEngineCleanSMTPBuffers(det_ctx); } } PACKET_PROFILING_DETECT_END(p, PROF_DETECT_CLEANUP);