diff options
author | Pauli <ppzgs1@gmail.com> | 2021-03-17 17:59:34 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-03-20 10:18:33 +1000 |
commit | c38048e793e4cdf21759d4b068561d3bb0041ae6 (patch) | |
tree | 6fa7dd8800200914757c0f1d65c13e5daa14a1ce /test | |
parent | b6d1bd4eb8662fb89911d5823d9454ca924878e7 (diff) |
sslapitest: fix problem in cleanup on failure path
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14589)
Diffstat (limited to 'test')
-rw-r--r-- | test/sslapitest.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/sslapitest.c b/test/sslapitest.c index d46e73b312..edaadb170f 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -625,10 +625,14 @@ static int test_client_cert_verify_cb(void) end: X509_free(crt1); X509_free(crt2); - SSL_shutdown(clientssl); - SSL_shutdown(serverssl); - SSL_free(serverssl); - SSL_free(clientssl); + if (clientssl != NULL) { + SSL_shutdown(clientssl); + SSL_free(clientssl); + } + if (serverssl != NULL) { + SSL_shutdown(serverssl); + SSL_free(serverssl); + } SSL_CTX_free(sctx); SSL_CTX_free(cctx); |