mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-13 09:59:40 +00:00
ec_keymgmt: fix coverity 1474427: resource leak
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14637)
This commit is contained in:
parent
9d8c53ed16
commit
218e1263c4
@ -847,13 +847,13 @@ int sm2_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)
|
||||
ok = ok && EC_GROUP_check(EC_KEY_get0_group(eck), ctx);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user