From: Amir Mohammadi Date: Wed, 22 May 2024 16:18:51 +0000 (+0330) Subject: Fix potential memory leak in test_bad_dtls X-Git-Tag: openssl-3.0.14~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0bd7b9e2281a2a541c22a4ef91da5e95f8cf58f5;p=thirdparty%2Fopenssl.git Fix potential memory leak in test_bad_dtls Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/24464) (cherry picked from commit abe05fda8bdbfb35de7420cab31d5e459fabc874) --- diff --git a/test/bad_dtls_test.c b/test/bad_dtls_test.c index e6ee1ea09f6..1873a772fc4 100644 --- a/test/bad_dtls_test.c +++ b/test/bad_dtls_test.c @@ -503,7 +503,6 @@ static int test_bad_dtls(void) if (!TEST_ptr(con) || !TEST_true(SSL_set_session(con, sess))) goto end; - SSL_SESSION_free(sess); rbio = BIO_new(BIO_s_mem()); wbio = BIO_new(BIO_s_mem()); @@ -591,6 +590,7 @@ static int test_bad_dtls(void) testresult = 1; end: + SSL_SESSION_free(sess); BIO_free(rbio); BIO_free(wbio); SSL_free(con);