From: Victor Julien Date: Wed, 23 Feb 2022 19:58:57 +0000 (+0100) Subject: decode/vntag: don't leak memory in tests X-Git-Tag: suricata-7.0.0-beta1~846 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b7526bf4e62ff82a17d0449c103608b2d6d47d25;p=thirdparty%2Fsuricata.git decode/vntag: don't leak memory in tests --- diff --git a/src/decode-vntag.c b/src/decode-vntag.c index 960f916fef..56f536a804 100644 --- a/src/decode-vntag.c +++ b/src/decode-vntag.c @@ -109,6 +109,7 @@ static int DecodeVNTagtest01(void) FAIL_IF(TM_ECODE_OK == DecodeVNTag(&tv, &dtv, p, raw_vntag, sizeof(raw_vntag))); FAIL_IF_NOT(ENGINE_ISSET_EVENT(p, VNTAG_HEADER_TOO_SMALL)); + PacketFree(p); PASS; } @@ -136,6 +137,7 @@ static int DecodeVNTagtest02(void) memset(&dtv, 0, sizeof(DecodeThreadVars)); FAIL_IF_NOT(TM_ECODE_OK != DecodeVNTag(&tv, &dtv, p, raw_vntag, sizeof(raw_vntag))); + PacketFree(p); PASS; } @@ -166,8 +168,7 @@ static int DecodeVNTagtest03(void) PACKET_RECYCLE(p); FlowShutdown(); - SCFree(p); - + PacketFree(p); PASS; } #endif /* UNITTESTS */