From: Matt Caswell Date: Fri, 28 Jun 2019 14:06:55 +0000 (+0100) Subject: Fix a leak in evp_test X-Git-Tag: openssl-3.0.0-alpha1~1836 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=19ea6b2b375b15919f9f5f523d1312398315017f;p=oweals%2Fopenssl.git Fix a leak in evp_test If evp_test fails to load the legacy provider then it leaks a reference to the default provider. Reviewed-by: Richard Levitte Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/9270) --- diff --git a/test/evp_test.c b/test/evp_test.c index 6fc9f03797..b70b4ea600 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -3096,8 +3096,10 @@ int setup_tests(void) return 0; #ifndef NO_LEGACY_MODULE legacyprov = OSSL_PROVIDER_load(NULL, "legacy"); - if (!TEST_ptr(legacyprov)) + if (!TEST_ptr(legacyprov)) { + OSSL_PROVIDER_unload(defltprov); return 0; + } #endif /* NO_LEGACY_MODULE */ ADD_ALL_TESTS(run_file_tests, n);