diff options
Diffstat (limited to 'crypto/rand/rand_lib.c')
-rw-r--r-- | crypto/rand/rand_lib.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c index b43660b1fe..63fd231775 100644 --- a/crypto/rand/rand_lib.c +++ b/crypto/rand/rand_lib.c @@ -79,10 +79,8 @@ static const RAND_METHOD *default_RAND_meth = NULL; int RAND_set_rand_method(const RAND_METHOD *meth) { #ifndef OPENSSL_NO_ENGINE - if (funct_ref) { - ENGINE_finish(funct_ref); - funct_ref = NULL; - } + ENGINE_finish(funct_ref); + funct_ref = NULL; #endif default_RAND_meth = meth; return 1; @@ -95,7 +93,7 @@ const RAND_METHOD *RAND_get_rand_method(void) ENGINE *e = ENGINE_get_default_RAND(); if (e) { default_RAND_meth = ENGINE_get_RAND(e); - if (!default_RAND_meth) { + if (default_RAND_meth == NULL) { ENGINE_finish(e); e = NULL; } @@ -117,7 +115,7 @@ int RAND_set_rand_engine(ENGINE *engine) if (!ENGINE_init(engine)) return 0; tmp_meth = ENGINE_get_RAND(engine); - if (!tmp_meth) { + if (tmp_meth == NULL) { ENGINE_finish(engine); return 0; } |