]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix potential memory leak in test_bad_dtls
authorAmir Mohammadi <amiremohamadi@yahoo.com>
Wed, 22 May 2024 16:18:51 +0000 (19:48 +0330)
committerMatt Caswell <matt@openssl.org>
Wed, 29 May 2024 12:26:05 +0000 (13:26 +0100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24464)

test/bad_dtls_test.c

index 608377c8582649ce2005475038a0b55605c3a1b5..611bd4a6c4cfa237ab11c350925af8aa727db8cb 100644 (file)
@@ -508,7 +508,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());
@@ -596,6 +595,7 @@ static int test_bad_dtls(void)
     testresult = 1;
 
  end:
+    SSL_SESSION_free(sess);
     BIO_free(rbio);
     BIO_free(wbio);
     SSL_free(con);