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;
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;
}
if (!ENGINE_init(engine))
return 0;
tmp_meth = ENGINE_get_RAND(engine);
- if (!tmp_meth) {
+ if (tmp_meth == NULL) {
ENGINE_finish(engine);
return 0;
}