fix for memory leak on error

This commit is contained in:
JacobBarthelmeh
2024-03-19 00:58:32 +07:00
parent 4751af9b89
commit d51bef3d43

View File

@ -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;
}