diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2017-10-09 23:24:26 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2017-10-12 00:03:32 +0100 |
commit | 918a27facd3558444c69b1edbedb49478e82dff5 (patch) | |
tree | 7c2001b049187d5e48639664f1f33bf58d80f533 /crypto | |
parent | c2976edf4b22691d8bebb0e3ca2db18b3d0c71c6 (diff) | |
download | openssl-918a27facd3558444c69b1edbedb49478e82dff5.zip openssl-918a27facd3558444c69b1edbedb49478e82dff5.tar.gz openssl-918a27facd3558444c69b1edbedb49478e82dff5.tar.bz2 |
Fix memory leak on lookup failure
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4503)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/evp/pmeth_lib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index 31ec092..35e525b 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -129,6 +129,9 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id) pmeth = EVP_PKEY_meth_find(id); if (pmeth == NULL) { +#ifndef OPENSSL_NO_ENGINE + ENGINE_finish(e); +#endif EVPerr(EVP_F_INT_CTX_NEW, EVP_R_UNSUPPORTED_ALGORITHM); return NULL; } |