From d51bef3d430461e7b90d6ae3aa26ed26b3264ecf Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 19 Mar 2024 00:58:32 +0700 Subject: [PATCH] fix for memory leak on error --- wolfcrypt/src/pkcs7.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wolfcrypt/src/pkcs7.c b/wolfcrypt/src/pkcs7.c index ed3745ee1..997fd4f06 100644 --- a/wolfcrypt/src/pkcs7.c +++ b/wolfcrypt/src/pkcs7.c @@ -2597,6 +2597,8 @@ static int wc_PKCS7_EncodeContentStream(PKCS7* pkcs7, ESD* esd, void* aes, int szLeft = BER_OCTET_LENGTH; if (in == NULL) { + XFREE(encContentOut, heap, DYNAMIC_TYPE_PKCS7); + XFREE(contentData, heap, DYNAMIC_TYPE_PKCS7); return BAD_FUNC_ARG; }