From: Tomas Mraz Date: Thu, 11 Apr 2024 09:34:57 +0000 (+0200) Subject: test/prov_config_test.c: Cleanup and fix potential leaks X-Git-Tag: openssl-3.1.7~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e3945a012814b6bd91d065e6fa2f75c6a0a7fc98;p=thirdparty%2Fopenssl.git test/prov_config_test.c: Cleanup and fix potential leaks Fixes #24106 Reviewed-by: Tom Cosgrove Reviewed-by: Neil Horman Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/24107) (cherry picked from commit 140540189c67ba94188165b1144fdfb5b248bc02) --- diff --git a/test/prov_config_test.c b/test/prov_config_test.c index f93d8d62be6..2fd913deadf 100644 --- a/test/prov_config_test.c +++ b/test/prov_config_test.c @@ -26,15 +26,13 @@ static int test_double_config(void) int testresult = 0; EVP_MD *sha256 = NULL; - if (!TEST_ptr(configfile)) - return 0; if (!TEST_ptr(ctx)) return 0; if (!TEST_true(OSSL_LIB_CTX_load_config(ctx, configfile))) - return 0; + goto err; if (!TEST_true(OSSL_LIB_CTX_load_config(ctx, configfile))) - return 0; + goto err; /* Check we can actually fetch something */ sha256 = EVP_MD_fetch(ctx, "SHA2-256", NULL); @@ -54,9 +52,6 @@ static int test_recursive_config(void) int testresult = 0; unsigned long err; - if (!TEST_ptr(recurseconfigfile)) - goto err; - if (!TEST_ptr(ctx)) goto err;