summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNan Xiao <nan@chinadtrace.org>2021-04-01 13:55:04 +0800
committerPauli <pauli@openssl.org>2021-04-07 09:09:13 +1000
commitb84c0eaeda471affdb4771fd9ea655b701a44217 (patch)
tree6554de6da5e833332fd0258c0cbd46e956d43082 /test
parent46dc0bca6cd623c42489c57e62c69cf568335664 (diff)
Fix potential double free in sslapitest.c
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14758) (cherry picked from commit 493e78986f9677c2b321273da51c276b9a8182d8)
Diffstat (limited to 'test')
-rw-r--r--test/sslapitest.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/sslapitest.c b/test/sslapitest.c
index 4a27ee1ba2..665aa13c23 100644
--- a/test/sslapitest.c
+++ b/test/sslapitest.c
@@ -1826,8 +1826,10 @@ static int execute_test_ssl_bio(int pop_ssl, bio_change_t change_bio)
/* Verify changing the rbio/wbio directly does not cause leaks */
if (change_bio != NO_BIO_CHANGE) {
- if (!TEST_ptr(membio2 = BIO_new(BIO_s_mem())))
+ if (!TEST_ptr(membio2 = BIO_new(BIO_s_mem()))) {
+ ssl = NULL;
goto end;
+ }
if (change_bio == CHANGE_RBIO)
SSL_set0_rbio(ssl, membio2);
else