From cbaff02d66ae1eccc17f7cd6c76748a84dcfbeaf Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 7 Oct 2025 16:56:29 +0200 Subject: [PATCH] unittests: clean up memory in ftp tests --- src/app-layer-ftp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/app-layer-ftp.c b/src/app-layer-ftp.c index 17ea5cd127..7f0fab4725 100644 --- a/src/app-layer-ftp.c +++ b/src/app-layer-ftp.c @@ -26,6 +26,7 @@ */ #include "suricata-common.h" + #include "app-layer-ftp.h" #include "app-layer.h" #include "app-layer-parser.h" @@ -1411,6 +1412,7 @@ void FTPParserCleanup(void) /* UNITTESTS */ #ifdef UNITTESTS +#include "flow-util.h" #include "stream-tcp.h" /** \test Send a get request in one chunk. */ @@ -1439,6 +1441,7 @@ static int FTPParserTest01(void) FAIL_IF_NULL(ftp_state); FAIL_IF(ftp_state->command != FTP_COMMAND_PORT); + FLOW_DESTROY(&f); AppLayerParserThreadCtxFree(alp_tctx); StreamTcpFreeConfig(true); PASS; @@ -1486,6 +1489,7 @@ static int FTPParserTest11(void) FAIL_IF(ftp_state->command != FTP_COMMAND_RETR); + FLOW_DESTROY(&f); AppLayerParserThreadCtxFree(alp_tctx); StreamTcpFreeConfig(true); PASS; @@ -1533,6 +1537,7 @@ static int FTPParserTest12(void) FAIL_IF(ftp_state->command != FTP_COMMAND_STOR); + FLOW_DESTROY(&f); AppLayerParserThreadCtxFree(alp_tctx); StreamTcpFreeConfig(true); PASS;