aboutsummaryrefslogtreecommitdiff
path: root/test/provider_fallback_test.c
diff options
context:
space:
mode:
authorGordon Tetlow <gordon@FreeBSD.org>2024-09-04 03:56:17 +0000
committerGordon Tetlow <gordon@FreeBSD.org>2024-09-04 03:56:17 +0000
commit108164cf95d9594884c2dcccba2691335e6f221b (patch)
tree4e7056d88b26a82672d06a7aca8052b58615ca2f /test/provider_fallback_test.c
parente60dbfd00b009d424dfc5446d132872c93dd0aed (diff)
Diffstat (limited to 'test/provider_fallback_test.c')
-rw-r--r--test/provider_fallback_test.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/provider_fallback_test.c b/test/provider_fallback_test.c
index 5902f57c85e7..26ba9ea1dcb0 100644
--- a/test/provider_fallback_test.c
+++ b/test/provider_fallback_test.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -39,9 +39,15 @@ static int test_explicit_provider(void)
int ok;
ok = TEST_ptr(ctx = OSSL_LIB_CTX_new())
- && TEST_ptr(prov = OSSL_PROVIDER_load(ctx, "default"))
- && test_provider(ctx)
- && TEST_true(OSSL_PROVIDER_unload(prov));
+ && TEST_ptr(prov = OSSL_PROVIDER_load(ctx, "default"));
+
+ if (ok) {
+ ok = test_provider(ctx);
+ if (ok)
+ ok = TEST_true(OSSL_PROVIDER_unload(prov));
+ else
+ OSSL_PROVIDER_unload(prov);
+ }
OSSL_LIB_CTX_free(ctx);
return ok;