From 92b7ffad6980da26d3faf789a804a8a12722bc7e Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 28 Jun 2013 12:28:51 +0200 Subject: [PATCH] Improve memory cleanup in some unittests --- src/app-layer-ssl.c | 1 + src/stream-tcp-reassemble.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app-layer-ssl.c b/src/app-layer-ssl.c index 141f1360fc..9e1413851e 100644 --- a/src/app-layer-ssl.c +++ b/src/app-layer-ssl.c @@ -2538,6 +2538,7 @@ static int SSLParserTest21(void) result = 1; end: + StreamTcpFreeConfig(TRUE); FLOW_DESTROY(&f); return result; } diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 2e14434567..72f7818ee8 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -8380,6 +8380,7 @@ static int StreamTcpReassembleInlineTest10(void) { ThreadVars tv; TcpSession ssn; Flow *f = NULL; + Packet *p = NULL; memset(&tv, 0x00, sizeof(tv)); @@ -8396,7 +8397,7 @@ static int StreamTcpReassembleInlineTest10(void) { uint8_t stream_payload2[] = "T /"; uint8_t stream_payload3[] = "HTTP/1.0\r\n\r\n"; - Packet *p = UTHBuildPacketReal(stream_payload3, 12, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80); + p = UTHBuildPacketReal(stream_payload3, 12, IPPROTO_TCP, "1.1.1.1", "2.2.2.2", 1024, 80); if (p == NULL) { printf("couldn't get a packet: "); goto end; @@ -8446,12 +8447,9 @@ static int StreamTcpReassembleInlineTest10(void) { ret = 1; end: -#if 0 - FLOW_DESTROY(&f); UTHFreePacket(p); StreamTcpUTClearSession(&ssn); StreamTcpUTDeinit(ra_ctx); -#endif UTHFreeFlow(f); return ret; }