]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: fix memleak on bad traffic
authorVictor Julien <victor@inliniac.net>
Thu, 23 Feb 2017 15:45:32 +0000 (16:45 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 24 Mar 2017 14:16:50 +0000 (15:16 +0100)
If state was alloc'd after protocol detection, but then the direction
turned out to be wrong, the state would not be freed.

src/app-layer.c

index 5d0fa13581a95501208a1501b317435a696c3909..471f358b5d5b3cca1c8519e25c1354392ebfe3dc 100644 (file)
@@ -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;