summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-03-22 08:37:56 +1000
committerPauli <pauli@openssl.org>2021-04-08 08:49:27 +1000
commit09fba0b44032c2f66d5e7e8c732869e031ce74c8 (patch)
treeda41142cfbca27d6b250adbf58ea6806e44efc0c
parentfd0a9ff7ef0db7441baf8626f53e37a10d22449d (diff)
fix coverity 1466710: resource leak
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14620)
-rw-r--r--providers/implementations/keymgmt/ec_kmgmt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c
index ed1b412225..58283ca8f0 100644
--- a/providers/implementations/keymgmt/ec_kmgmt.c
+++ b/providers/implementations/keymgmt/ec_kmgmt.c
@@ -900,13 +900,13 @@ int ec_validate(const void *keydata, int selection, int checktype)
if (!ossl_prov_is_running())
return 0;
+ if ((selection & EC_POSSIBLE_SELECTIONS) == 0)
+ return 1; /* nothing to validate */
+
ctx = BN_CTX_new_ex(ossl_ec_key_get_libctx(eck));
if (ctx == NULL)
return 0;
- if ((selection & EC_POSSIBLE_SELECTIONS) == 0)
- return 1; /* nothing to validate */
-
if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0) {
int flags = EC_KEY_get_flags(eck);