diff --git a/ctaocrypt/src/asn.c b/ctaocrypt/src/asn.c index dbd505afd..fd1d2ace8 100644 --- a/ctaocrypt/src/asn.c +++ b/ctaocrypt/src/asn.c @@ -5742,6 +5742,8 @@ static int SetDatesFromCert(Cert* cert, const byte* der, int derSz) cert->beforeDateSz = decoded.beforeDateLen; cert->afterDateSz = decoded.afterDateLen; + FreeDecodedCert(&decoded); + return 0; } diff --git a/ctaocrypt/src/pkcs7.c b/ctaocrypt/src/pkcs7.c index df6ba61f2..9e3706da0 100644 --- a/ctaocrypt/src/pkcs7.c +++ b/ctaocrypt/src/pkcs7.c @@ -1075,6 +1075,7 @@ CYASSL_LOCAL int CreateRecipientInfo(const byte* cert, word32 certSz, if (RsaPublicKeyDecode(decoded->publicKey, &idx, pubKey, decoded->pubKeySize) < 0) { CYASSL_MSG("ASN RSA key decode error"); + FreeRsaKey(pubKey); FreeDecodedCert(decoded); #ifdef CYASSL_SMALL_STACK XFREE(pubKey, NULL, DYNAMIC_TYPE_TMP_BUFFER);