Skip to content

Commit 7b20a55

Browse files
Fix for CID 330399 memory leak on error case
1 parent c11176c commit 7b20a55

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33607,6 +33607,9 @@ int DecodeAsymKey(const byte* input, word32* inOutIdx, word32 inSz,
3360733607

3360833608
if (input == NULL || inOutIdx == NULL || inSz == 0 ||
3360933609
privKey == NULL || privKeyLen == NULL) {
33610+
#ifdef WOLFSSL_ASN_TEMPLATE
33611+
FREE_ASNGETDATA(dataASN, NULL);
33612+
#endif
3361033613
return BAD_FUNC_ARG;
3361133614
}
3361233615

0 commit comments

Comments
 (0)