From f2c8826e16e84acdf00df489b04637a9b0449beb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Guimar=C3=A3es?= Date: Mon, 23 Jun 2014 15:28:57 -0300 Subject: [PATCH 1/3] fix missing FreeRsaKey on error. --- ctaocrypt/src/pkcs7.c | 1 + 1 file changed, 1 insertion(+) 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); From e2a6d68abf066e36e606678766f567ae3523180e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Guimar=C3=A3es?= Date: Tue, 24 Jun 2014 20:03:52 -0300 Subject: [PATCH 2/3] fix - add missing FreeDecodeCert on success. --- ctaocrypt/src/asn.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ctaocrypt/src/asn.c b/ctaocrypt/src/asn.c index eb1af4bc3..6e579b368 100644 --- a/ctaocrypt/src/asn.c +++ b/ctaocrypt/src/asn.c @@ -5726,7 +5726,9 @@ static int SetDatesFromCert(Cert* cert, const byte* der, int derSz) cert->beforeDateSz = decoded.beforeDateLen; cert->afterDateSz = decoded.afterDateLen; - + + FreeDecodedCert(&decoded); + return 0; } From eb56afdbf639c2b287253c6b0c9d024acda7a0f6 Mon Sep 17 00:00:00 2001 From: toddouska Date: Wed, 25 Jun 2014 09:28:44 -0600 Subject: [PATCH 3/3] remove spaces --- ctaocrypt/src/asn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctaocrypt/src/asn.c b/ctaocrypt/src/asn.c index 6e579b368..be7c505b9 100644 --- a/ctaocrypt/src/asn.c +++ b/ctaocrypt/src/asn.c @@ -5726,9 +5726,9 @@ static int SetDatesFromCert(Cert* cert, const byte* der, int derSz) cert->beforeDateSz = decoded.beforeDateLen; cert->afterDateSz = decoded.afterDateLen; - + FreeDecodedCert(&decoded); - + return 0; }