From: Frédéric Lécaille Date: Tue, 8 Aug 2023 08:50:51 +0000 (+0200) Subject: MINOR: quic: Release asap quic_conn memory from ->close() xprt callback. X-Git-Tag: v2.9-dev3~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab9523020027683746a6170ef7ef0e435e2b47dc;p=thirdparty%2Fhaproxy.git MINOR: quic: Release asap quic_conn memory from ->close() xprt callback. Add a condition to release asap the quic_conn memory when the connection is in "connection close" state from ->close() QUIC xprt callback. --- diff --git a/src/xprt_quic.c b/src/xprt_quic.c index c3b9c6a731..d23ac89334 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -28,8 +28,10 @@ static void quic_close(struct connection *conn, void *xprt_ctx) /* Next application data can be dropped. */ qc->mux_state = QC_MUX_RELEASED; - /* If the quic-conn timer has already expired free the quic-conn. */ - if (qc->flags & QUIC_FL_CONN_EXP_TIMER) { + /* If the quic-conn timer has already expired or if already in "connection close" + * state, free the quic-conn. + */ + if (qc->flags & (QUIC_FL_CONN_EXP_TIMER|QUIC_FL_CONN_CLOSING)) { quic_conn_release(qc); qc = NULL; goto leave;