Skip to content

Commit

Permalink
test/prov_config_test.c: Cleanup and fix potential leaks
Browse files Browse the repository at this point in the history
Fixes openssl#24106

Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from openssl#24107)

(cherry picked from commit 1405401)
  • Loading branch information
t8m committed Jun 7, 2024
1 parent 080723d commit e3945a0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions test/prov_config_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

Expand Down

0 comments on commit e3945a0

Please # to comment.