]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
ftp: fix memory leak 850/head
authorVictor Julien <victor@inliniac.net>
Tue, 25 Feb 2014 21:52:18 +0000 (22:52 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 25 Feb 2014 21:52:18 +0000 (22:52 +0100)
db pointers in both directions were not freed. This patch frees them
in the state free function.

Bug #1090

src/app-layer-ftp.c

index 6fc63b74eaf8854de82ea40c9090271d3f3da181..3e1cf3056634e8df2e1699f657c6168fc7c86c71 100644 (file)
@@ -290,6 +290,10 @@ static void FTPStateFree(void *s) {
     FtpState *fstate = (FtpState *) s;
     if (fstate->port_line != NULL)
         SCFree(fstate->port_line);
+    if (fstate->line_state[0].db)
+        SCFree(fstate->line_state[0].db);
+    if (fstate->line_state[1].db)
+        SCFree(fstate->line_state[1].db);
     SCFree(s);
 #ifdef DEBUG
     SCMutexLock(&ftp_state_mem_lock);