summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2023-09-20 16:25:44 +0100
committerMatt Caswell <matt@openssl.org>2023-09-22 13:56:43 +0100
commit18fd0ea04d6bd37809a4e9a669c49cf9bc146bfb (patch)
treec5d167544610b76b8079c439597abc383f185bee /ssl
parentf13f9b716e8b148b97dbe49e823b9dc3f235de1f (diff)
Ensure we free all the BIOs in a chain for QUIC like we do in TLS
An application may pass in a whole BIO chain via SSL_set_bio(). When we free the BIO we should be using BIO_free_all() not BIO_free() like we do with TLS. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22157)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/quic/quic_impl.c8
-rw-r--r--ssl/quic/quic_tserver.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c
index beec26c019..cb927fa52d 100644
--- a/ssl/quic/quic_impl.c
+++ b/ssl/quic/quic_impl.c
@@ -545,8 +545,8 @@ void ossl_quic_free(SSL *s)
ossl_quic_channel_free(ctx.qc->ch);
- BIO_free(ctx.qc->net_rbio);
- BIO_free(ctx.qc->net_wbio);
+ BIO_free_all(ctx.qc->net_rbio);
+ BIO_free_all(ctx.qc->net_wbio);
/* Note: SSL_free calls OPENSSL_free(qc) for us */
@@ -876,7 +876,7 @@ void ossl_quic_conn_set0_net_rbio(SSL *s, BIO *net_rbio)
if (!ossl_quic_channel_set_net_rbio(ctx.qc->ch, net_rbio))
return;
- BIO_free(ctx.qc->net_rbio);
+ BIO_free_all(ctx.qc->net_rbio);
ctx.qc->net_rbio = net_rbio;
if (net_rbio != NULL)
@@ -903,7 +903,7 @@ void ossl_quic_conn_set0_net_wbio(SSL *s, BIO *net_wbio)
if (!ossl_quic_channel_set_net_wbio(ctx.qc->ch, net_wbio))
return;
- BIO_free(ctx.qc->net_wbio);
+ BIO_free_all(ctx.qc->net_wbio);
ctx.qc->net_wbio = net_wbio;
if (net_wbio != NULL)
diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c
index 92c17d10f3..3630577e70 100644
--- a/ssl/quic/quic_tserver.c
+++ b/ssl/quic/quic_tserver.c
@@ -159,8 +159,8 @@ void ossl_quic_tserver_free(QUIC_TSERVER *srv)
return;
ossl_quic_channel_free(srv->ch);
- BIO_free(srv->args.net_rbio);
- BIO_free(srv->args.net_wbio);
+ BIO_free_all(srv->args.net_rbio);
+ BIO_free_all(srv->args.net_wbio);
OPENSSL_free(srv->ssl);
SSL_free(srv->tls);
SSL_CTX_free(srv->ctx);