Improve memory cleanup in some unittests

pull/414/head
Victor Julien 12 years ago
parent fd7899cc8b
commit 92b7ffad69

@ -2538,6 +2538,7 @@ static int SSLParserTest21(void)
result = 1; result = 1;
end: end:
StreamTcpFreeConfig(TRUE);
FLOW_DESTROY(&f); FLOW_DESTROY(&f);
return result; return result;
} }

@ -8380,6 +8380,7 @@ static int StreamTcpReassembleInlineTest10(void) {
ThreadVars tv; ThreadVars tv;
TcpSession ssn; TcpSession ssn;
Flow *f = NULL; Flow *f = NULL;
Packet *p = NULL;
memset(&tv, 0x00, sizeof(tv)); memset(&tv, 0x00, sizeof(tv));
@ -8396,7 +8397,7 @@ static int StreamTcpReassembleInlineTest10(void) {
uint8_t stream_payload2[] = "T /"; uint8_t stream_payload2[] = "T /";
uint8_t stream_payload3[] = "HTTP/1.0\r\n\r\n"; 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) { if (p == NULL) {
printf("couldn't get a packet: "); printf("couldn't get a packet: ");
goto end; goto end;
@ -8446,12 +8447,9 @@ static int StreamTcpReassembleInlineTest10(void) {
ret = 1; ret = 1;
end: end:
#if 0
FLOW_DESTROY(&f);
UTHFreePacket(p); UTHFreePacket(p);
StreamTcpUTClearSession(&ssn); StreamTcpUTClearSession(&ssn);
StreamTcpUTDeinit(ra_ctx); StreamTcpUTDeinit(ra_ctx);
#endif
UTHFreeFlow(f); UTHFreeFlow(f);
return ret; return ret;
} }

Loading…
Cancel
Save