]> 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)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 11 Sep 2024 08:00:08 +0000 (18:00 +1000)
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 dff1c485cf3d09a133b294eed8afe3cbfbd82d2e..0a28bd9b5a3e2261414bbed55df82ea47bb2ccbe 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;