From: Olivier Houchard Date: Wed, 18 Nov 2026 15:55:27 +0000 (+0100) Subject: BUG/MINOR: mux-quic: fix QMux Rx buffer leak on MUX init failure X-Git-Url: https://git.kaiwu.me/web/%22data:,/doc/static/%7B@url%7D?a=commitdiff_plain;h=e09666921589c4bf0ef63c9fcfcb95af79637974;p=haproxy.git BUG/MINOR: mux-quic: fix QMux Rx buffer leak on MUX init failure On QMux, qcm_init() takes over the Rx buffer of the xprt layer. When it fails later, its error path resets qcc->conn before calling qcc_release(), which only releases the QMux connection buffers when a connection is attached, so the Rx buffer is leaked. A client connecting with TLS but without ALPN to a "proto qmux" listener makes qcc_install_app_ops() fail and leaks one buffer per connection. Let's release the QMux Rx buffer in the qcm_init() error path, where the connection type is still known. The Tx one cannot be allocated yet. This was introduced in 3.4 by commit 81f22cd68 ("MINOR: mux-quic: define Rx connection buffer for QMux") and must be backported to 3.4. --- diff --git a/src/mux_quic.c b/src/mux_quic.c index b41eedb31..d00aaeb8c 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -4325,6 +4325,12 @@ static int qcm_init(struct connection *conn, struct proxy *prx, } if (qcc) { + /* qcc_release() cannot free the QMux Rx buffer without conn */ + if (!conn_is_quic(conn)) { + b_free(&qcc->rx.qmux_buf); + offer_buffers(NULL, 1); + } + /* In case of MUX init failure, session will ensure connection is freed. */ qcc->conn = NULL; qcc_release(qcc);