From 2280358146b620647c51a5b940dd9104c4ea3a3f Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 27 Apr 2016 13:22:29 +0100 Subject: Don't leak EVP_MD_CTX on error path The cms_SignerInfo_content_sign() function allocated an EVP_MD_CTX but then failed to free it on an error path. Reviewed-by: Richard Levitte --- crypto/cms/cms_sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crypto/cms') diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c index 151f40f9a5..e4739b39d9 100644 --- a/crypto/cms/cms_sd.c +++ b/crypto/cms/cms_sd.c @@ -588,7 +588,7 @@ static int cms_SignerInfo_content_sign(CMS_ContentInfo *cms, if (!si->pkey) { CMSerr(CMS_F_CMS_SIGNERINFO_CONTENT_SIGN, CMS_R_NO_PRIVATE_KEY); - return 0; + goto err; } if (!cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) -- cgit v1.2.3