Skip to content

Commit

Permalink
decode/vntag: don't leak memory in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Feb 24, 2022
1 parent 0437ca6 commit b7526bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/decode-vntag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -166,8 +168,7 @@ static int DecodeVNTagtest03(void)

PACKET_RECYCLE(p);
FlowShutdown();
SCFree(p);

PacketFree(p);
PASS;
}
#endif /* UNITTESTS */
Expand Down

0 comments on commit b7526bf

Please sign in to comment.