Commit 3ecae5960a for openssl.org

commit 3ecae5960a16317c0195c01a9e640ea884c16871
Author: Eugene Syromiatnikov <esyr@openssl.org>
Date:   Tue Apr 28 12:02:48 2026 +0200

    ssl/record/methods/tls_common.c: call BIO_free_all() on rl->bio in tls_int_free

    Since it is free'd using this call in tls_set1_bio().

    Complements: 435feadaf4f9 "Fix record layer leak when swapping chained transport BIO"
    Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>

    Reviewed-by: Matt Caswell <matt@openssl.foundation>
    Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
    MergeDate: Sat May  2 18:10:42 2026
    (Merged from https://github.com/openssl/openssl/pull/31011)

diff --git a/ssl/record/methods/tls_common.c b/ssl/record/methods/tls_common.c
index 7de395f277..c8e5218226 100644
--- a/ssl/record/methods/tls_common.c
+++ b/ssl/record/methods/tls_common.c
@@ -1398,7 +1398,7 @@ err:
 static void tls_int_free(OSSL_RECORD_LAYER *rl)
 {
     BIO_free(rl->prev);
-    BIO_free(rl->bio);
+    BIO_free_all(rl->bio);
     BIO_free(rl->next);
     ossl_tls_buffer_release(&rl->rbuf);