From: Victor Julien Date: Thu, 23 Feb 2017 15:45:32 +0000 (+0100) Subject: app-layer: fix memleak on bad traffic X-Git-Tag: suricata-4.0.0-beta1~263 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c0a3b558229274cb12fdd080c132c3f2049f31f;p=thirdparty%2Fsuricata.git app-layer: fix memleak on bad traffic If state was alloc'd after protocol detection, but then the direction turned out to be wrong, the state would not be freed. --- diff --git a/src/app-layer.c b/src/app-layer.c index 5d0fa13581..471f358b5d 100644 --- a/src/app-layer.c +++ b/src/app-layer.c @@ -145,6 +145,7 @@ static void DisableAppLayer(ThreadVars *tv, Flow *f, Packet *p) { SCLogDebug("disable app layer for flow %p alproto %u ts %u tc %u", f, f->alproto, f->alproto_ts, f->alproto_tc); + FlowCleanupAppLayer(f); StreamTcpDisableAppLayer(f); TcpSession *ssn = f->protoctx; ssn->data_first_seen_dir = APP_LAYER_DATA_ALREADY_SENT_TO_APP_LAYER;