diff --git a/test/sslapitest.c b/test/sslapitest.c index 22e8dd12b1143..2a9c36673a204 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -9388,8 +9388,11 @@ static int test_session_cache_overflow(int idx) * Cause this session to have a longer timeout than the next session to * be added. */ - if (!TEST_true(SSL_SESSION_set_timeout(sess, LONG_MAX))) + if (!TEST_true(SSL_SESSION_set_timeout(sess, LONG_MAX))) { + sess = NULL; goto end; + } + sess = NULL; } SSL_shutdown(serverssl); @@ -9433,12 +9436,10 @@ static int test_session_cache_overflow(int idx) if (!TEST_true(SSL_set_session(clientssl, sess))) goto end; - sess = NULL; if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) goto end; - testresult = 1; end: