diff options
Diffstat (limited to 'src/lib/libcrypto/evp/pmeth_lib.c')
-rw-r--r-- | src/lib/libcrypto/evp/pmeth_lib.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/libcrypto/evp/pmeth_lib.c b/src/lib/libcrypto/evp/pmeth_lib.c index fc5f4ef91e..6b86a0ecfb 100644 --- a/src/lib/libcrypto/evp/pmeth_lib.c +++ b/src/lib/libcrypto/evp/pmeth_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pmeth_lib.c,v 1.13 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: pmeth_lib.c,v 1.14 2018/04/14 07:09:21 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2006. | 3 | * project 2006. |
4 | */ | 4 | */ |
@@ -188,10 +188,9 @@ int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id) | |||
188 | } | 188 | } |
189 | 189 | ||
190 | ret = malloc(sizeof(EVP_PKEY_CTX)); | 190 | ret = malloc(sizeof(EVP_PKEY_CTX)); |
191 | if (!ret) { | 191 | if (ret == NULL) { |
192 | #ifndef OPENSSL_NO_ENGINE | 192 | #ifndef OPENSSL_NO_ENGINE |
193 | if (e) | 193 | ENGINE_finish(e); |
194 | ENGINE_finish(e); | ||
195 | #endif | 194 | #endif |
196 | EVPerror(ERR_R_MALLOC_FAILURE); | 195 | EVPerror(ERR_R_MALLOC_FAILURE); |
197 | return NULL; | 196 | return NULL; |
@@ -394,10 +393,7 @@ EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx) | |||
394 | EVP_PKEY_free(ctx->pkey); | 393 | EVP_PKEY_free(ctx->pkey); |
395 | EVP_PKEY_free(ctx->peerkey); | 394 | EVP_PKEY_free(ctx->peerkey); |
396 | #ifndef OPENSSL_NO_ENGINE | 395 | #ifndef OPENSSL_NO_ENGINE |
397 | if (ctx->engine) | 396 | ENGINE_finish(ctx->engine); |
398 | /* The EVP_PKEY_CTX we used belongs to an ENGINE, release the | ||
399 | * functional reference we held for this reason. */ | ||
400 | ENGINE_finish(ctx->engine); | ||
401 | #endif | 397 | #endif |
402 | free(ctx); | 398 | free(ctx); |
403 | } | 399 | } |