Fix memory leak if setup fails.
Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 891eac4604
)
Conflicts:
crypto/cms/cms_enc.c
This commit is contained in:
parent
e9da86627a
commit
056df45ed1
1 changed files with 1 additions and 1 deletions
|
@ -195,7 +195,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec)
|
|||
ok = 1;
|
||||
|
||||
err:
|
||||
if (ec->key && !keep_key) {
|
||||
if (ec->key && (!keep_key || !ok)) {
|
||||
OPENSSL_cleanse(ec->key, ec->keylen);
|
||||
OPENSSL_free(ec->key);
|
||||
ec->key = NULL;
|
||||
|
|
Loading…
Reference in a new issue