Fix for CID 330399 memory leak on error case

This commit is contained in:
JacobBarthelmeh
2023-10-27 14:11:21 -06:00
parent c11176c276
commit 7b20a5597c

View File

@ -33607,6 +33607,9 @@ int DecodeAsymKey(const byte* input, word32* inOutIdx, word32 inSz,
if (input == NULL || inOutIdx == NULL || inSz == 0 ||
privKey == NULL || privKeyLen == NULL) {
#ifdef WOLFSSL_ASN_TEMPLATE
FREE_ASNGETDATA(dataASN, NULL);
#endif
return BAD_FUNC_ARG;
}