diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-08-01 15:37:44 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2015-08-12 13:54:56 +0100 |
commit | 891eac4604b5f05413e59602fae1f11136f4719a (patch) | |
tree | 84d3b30c09ac1dc754b9388b3a599d8c30d00026 /crypto/cms | |
parent | a187e08d856690b5c1da3184d0ff560d572f893b (diff) |
Fix memory leak if setup fails.
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'crypto/cms')
-rw-r--r-- | crypto/cms/cms_enc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/cms/cms_enc.c b/crypto/cms/cms_enc.c index f9556acc2e..16b42251d1 100644 --- a/crypto/cms/cms_enc.c +++ b/crypto/cms/cms_enc.c @@ -194,7 +194,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) ok = 1; err: - if (!keep_key) { + if (!keep_key || !ok) { OPENSSL_clear_free(ec->key, ec->keylen); ec->key = NULL; } |