]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: quic: Fix memory leak in quic_deallocate_dghdlrs()
authorFrederic Lecaille <flecaille@haproxy.com>
Tue, 19 May 2026 15:06:08 +0000 (17:06 +0200)
committerFrederic Lecaille <flecaille@haproxy.com>
Thu, 28 May 2026 05:30:29 +0000 (07:30 +0200)
When deallocating the QUIC datagram handlers, the per-thread buffer
allocated inside quic_dghdlrs[i].buf.buffer was missing a free().
This led to a memory leak on exit or reload.

Fix this by freeing each thread buffer before releasing the main
quic_dghdlrs array.

src/proto_quic.c

index fb606e32396bd505c1a44cb3491104b175bf3c55..4becdea3250af36e6e2742ad2d1cc0299ba43e3b 100644 (file)
@@ -625,8 +625,10 @@ static int quic_deallocate_dghdlrs(void)
        int i;
 
        if (quic_dghdlrs) {
-               for (i = 0; i < global.nbthread; ++i)
+               for (i = 0; i < global.nbthread; ++i) {
+                       free(quic_dghdlrs[i].buf.buffer);
                        tasklet_free(quic_dghdlrs[i].task);
+               }
                free(quic_dghdlrs);
        }