diff --git a/lib/dns/openssl_link.c b/lib/dns/openssl_link.c index 005e7832d3..c361c3083b 100644 --- a/lib/dns/openssl_link.c +++ b/lib/dns/openssl_link.c @@ -110,6 +110,7 @@ cleanup_rm: if (global_engine != NULL) { ENGINE_free(global_engine); } + ERR_clear_error(); global_engine = NULL; #endif /* if !defined(OPENSSL_NO_ENGINE) && OPENSSL_API_LEVEL < 30000 */ return (DST_R_NOENGINE);