From 39f6bf33e5852be55b126c3fcc56e3ef5ab1a584 Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 18 Mar 2021 14:08:06 +1000 Subject: [PATCH] test: fix Coverity 1454818: use after free Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/14597) --- test/cipherlist_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/cipherlist_test.c b/test/cipherlist_test.c index 380f0727fc..9739cb58c4 100644 --- a/test/cipherlist_test.c +++ b/test/cipherlist_test.c @@ -205,8 +205,10 @@ static int test_default_cipherlist_explicit(void) { SETUP_CIPHERLIST_TEST_FIXTURE(); if (!TEST_true(SSL_CTX_set_cipher_list(fixture->server, "DEFAULT")) - || !TEST_true(SSL_CTX_set_cipher_list(fixture->client, "DEFAULT"))) + || !TEST_true(SSL_CTX_set_cipher_list(fixture->client, "DEFAULT"))) { tear_down(fixture); + fixture = NULL; + } EXECUTE_CIPHERLIST_TEST(); return result; }