From: Olivier Houchard Date: Wed, 22 Apr 2026 16:57:39 +0000 (+0200) Subject: BUG/MINOR: H2: Don't forget to free shared_rx_bufs on failure X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=dca4c379cebbc31f94f1c0128fe7b18e0d498805;p=thirdparty%2Fhaproxy.git BUG/MINOR: H2: Don't forget to free shared_rx_bufs on failure In h2_init(), if we have a failure while creating the h2c, and we allocated shared_tx_bufs, don't forget to free it, otherwise we'll have a memory leak. This was introduced in 3.1 by commit a891534bfd ("MINOR: mux-h2: allocate the array of shared rx bufs in the h2c"), so the fix should be backported as far as 3.2. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index ab15221e3..2ff7b2c2f 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -1519,6 +1519,7 @@ static int h2_init(struct connection *conn, struct proxy *prx, struct session *s fail: task_destroy(t); tasklet_free(h2c->wait_event.tasklet); + pool_free(pool_head_h2_rx_bufs, h2c->shared_rx_bufs); pool_free(pool_head_h2c, h2c); fail_no_h2c: if (!conn_is_back(conn))