summaryrefslogtreecommitdiffstats
path: root/crypto/cms
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-04-27 13:22:29 +0100
committerMatt Caswell <matt@openssl.org>2016-04-28 13:13:09 +0100
commit2280358146b620647c51a5b940dd9104c4ea3a3f (patch)
tree213310407c8ca29046c232da47a6fa1d52f445b1 /crypto/cms
parent29f4c357f045562d7eb7837ae890efc1bf4809a2 (diff)
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 <levitte@openssl.org>
Diffstat (limited to 'crypto/cms')
-rw-r--r--crypto/cms/cms_sd.c2
1 files changed, 1 insertions, 1 deletions
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))