Skip to content

Commit 3e70912

Browse files
author
Test User
committed
Add null checks for unit test faiure
1 parent 13bc9ee commit 3e70912

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

test/unit.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,18 @@ int main(int argc, char* argv[])
666666
err = run_tests(runAll);
667667
}
668668

669-
OSSL_PROVIDER_unload(osslProv);
670-
OSSL_LIB_CTX_free(osslLibCtx);
671-
OSSL_PROVIDER_unload(wpProv);
672-
OSSL_LIB_CTX_free(wpLibCtx);
669+
if (osslProv != NULL) {
670+
OSSL_PROVIDER_unload(osslProv);
671+
}
672+
if (osslLibCtx != NULL) {
673+
OSSL_LIB_CTX_free(osslLibCtx);
674+
}
675+
if (wpProv != NULL) {
676+
OSSL_PROVIDER_unload(wpProv);
677+
}
678+
if (wpLibCtx != NULL) {
679+
OSSL_LIB_CTX_free(wpLibCtx);
680+
}
673681

674682
OPENSSL_cleanup();
675683

0 commit comments

Comments
 (0)