From b4ab9a0a3cd3086f68b66ad7ca70d04e4335018b Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 25 Feb 2014 22:52:18 +0100 Subject: [PATCH] ftp: fix memory leak db pointers in both directions were not freed. This patch frees them in the state free function. Bug #1090 --- src/app-layer-ftp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app-layer-ftp.c b/src/app-layer-ftp.c index 6fc63b74ea..3e1cf30566 100644 --- a/src/app-layer-ftp.c +++ b/src/app-layer-ftp.c @@ -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);