]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Minor fix to BIO refcount handling
authorHugo Landau <hlandau@openssl.org>
Thu, 18 Jan 2024 16:33:27 +0000 (16:33 +0000)
committerNeil Horman <nhorman@openssl.org>
Mon, 17 Feb 2025 16:27:32 +0000 (11:27 -0500)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)

doc/man3/SSL_new_listener.pod
ssl/quic/quic_impl.c

index 3431828ece5dd18da219d344dc4293ae7f91439a..b3cbc70ea1f8643d0e8ee6145347be24eb7a1e0a 100644 (file)
@@ -199,7 +199,7 @@ OSSL_QUIC_server_method() was added in OpenSSL @VERSION_QUIC_SERVER@.
 
 =head1 COPYRIGHT
 
-Copyright 2022-2024 The OpenSSL Project Authors. All Rights Reserved.
+Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
 
 Licensed under the Apache License 2.0 (the "License").  You may not use
 this file except in compliance with the License.  You can obtain a copy
index cbedf0096822b7eda0b81ad5c23c7aabb1a9d729..e3e56b0e3f802a4cc0ab7e7969d1636056e2993f 100644 (file)
@@ -527,8 +527,18 @@ static void qc_cleanup(QUIC_CONNECTION *qc, int have_lock)
     ossl_quic_channel_free(qc->ch);
     qc->ch = NULL;
 
-    ossl_quic_port_free(qc->port);
-    qc->port = NULL;
+    if (qc->port != NULL) {
+        BIO *b;
+
+        b = ossl_quic_port_get_net_rbio(qc->port);
+        BIO_free_all(b);
+
+        b = ossl_quic_port_get_net_wbio(qc->port);
+        BIO_free_all(b);
+
+        ossl_quic_port_free(qc->port);
+        qc->port = NULL;
+    }
 
     ossl_quic_engine_free(qc->engine);
     qc->engine = NULL;