diff options
author | Rich Salz <rsalz@akamai.com> | 2016-02-25 12:09:06 -0500 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2016-02-25 15:19:42 -0500 |
commit | 7c96dbcdab959fef74c4caae63cdebaa354ab252 (patch) | |
tree | af59789bb5bc85efd7e700d657db004910f8ba64 /crypto/engine | |
parent | 07b3ce8f8029f647c1babf0d8a03599885e7e284 (diff) |
GH715: ENGINE_finish can take NULL
Simplifies calling code. Also fixed up any !ptr tests that were
nearby, turning them into NULL tests.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/engine')
-rw-r--r-- | crypto/engine/eng_cnf.c | 1 | ||||
-rw-r--r-- | crypto/engine/eng_init.c | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/crypto/engine/eng_cnf.c b/crypto/engine/eng_cnf.c index ec8c4493f9..400b2291d8 100644 --- a/crypto/engine/eng_cnf.c +++ b/crypto/engine/eng_cnf.c @@ -227,6 +227,7 @@ static int int_engine_module_init(CONF_IMODULE *md, const CONF *cnf) static void int_engine_module_finish(CONF_IMODULE *md) { ENGINE *e; + while ((e = sk_ENGINE_pop(initialized_engines))) ENGINE_finish(e); sk_ENGINE_free(initialized_engines); diff --git a/crypto/engine/eng_init.c b/crypto/engine/eng_init.c index b66d476d80..ddf552a537 100644 --- a/crypto/engine/eng_init.c +++ b/crypto/engine/eng_init.c @@ -136,10 +136,8 @@ int ENGINE_finish(ENGINE *e) { int to_return = 1; - if (e == NULL) { - ENGINEerr(ENGINE_F_ENGINE_FINISH, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } + if (e == NULL) + return 1; CRYPTO_w_lock(CRYPTO_LOCK_ENGINE); to_return = engine_unlocked_finish(e, 1); CRYPTO_w_unlock(CRYPTO_LOCK_ENGINE); |