]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux_quic: free frames emitted with QMux master
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 28 Apr 2026 09:02:23 +0000 (11:02 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 28 Apr 2026 13:59:28 +0000 (15:59 +0200)
When using QUIC, mux instantiates quic_frame objects but does not free
them. This is performed only when acknowledgment are received.

This is not the case for QMux protocol, as the transport layer is much
simpler in this case. As such, mux is responsible to free up the frames
after emission.

This patch fixes qcc_qstrm_send_frames() by adding the necessary
qc_frm_free() calls as soon as a frame is emitted. This fixes a memory
leak. This function ensures that the freed object is removed from its
parent list, so LIST_DEL_INIT() is not necessary anymore.

No need to backport.

src/mux_quic_qstrm.c

index 68360cd090cb40b999c33e58bfd216d86cf84555..7d53d767631943350071bb80f259993e3b5109e2 100644 (file)
@@ -368,11 +368,12 @@ int qcc_qstrm_send_frames(struct qcc *qcc, struct list *frms)
                if (frm->type >= QUIC_FT_STREAM_8 && frm->type <= QUIC_FT_STREAM_F)
                        qstrm_ctrl_send(frm->stream.stream, frm->stream.len);
 
-               LIST_DEL_INIT(&frm->list);
                if (split_frm) {
+                       qc_frm_free(NULL, &split_frm);
                        frm = next_frm;
                        goto loop;
                }
+               qc_frm_free(NULL, &frm);
        }
 
  out: