Skip to content

Commit d51bef3

Browse files
fix for memory leak on error
1 parent 4751af9 commit d51bef3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

wolfcrypt/src/pkcs7.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,6 +2597,8 @@ static int wc_PKCS7_EncodeContentStream(PKCS7* pkcs7, ESD* esd, void* aes,
25972597
int szLeft = BER_OCTET_LENGTH;
25982598

25992599
if (in == NULL) {
2600+
XFREE(encContentOut, heap, DYNAMIC_TYPE_PKCS7);
2601+
XFREE(contentData, heap, DYNAMIC_TYPE_PKCS7);
26002602
return BAD_FUNC_ARG;
26012603
}
26022604

0 commit comments

Comments
 (0)