From: Amaury Denoyelle Date: Wed, 13 Apr 2022 14:54:52 +0000 (+0200) Subject: BUG/MINOR: mux-quic: prevent a crash in session_free on mux.destroy X-Git-Tag: v2.6-dev6~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2461bd534a1639775b2264a2f307e9684a912fc0;p=thirdparty%2Fhaproxy.git BUG/MINOR: mux-quic: prevent a crash in session_free on mux.destroy Implement qc_destroy. This callback is used to quickly release all MUX resources. session_free uses this callback. Currently, it can only be called if there was an error during connection initialization. If not defined, the process crashes. --- diff --git a/src/mux_quic.c b/src/mux_quic.c index 58e4759d04..a4ffe97c76 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -1057,6 +1057,15 @@ static int qc_init(struct connection *conn, struct proxy *prx, return -1; } +static void qc_destroy(void *ctx) +{ + struct qcc *qcc = ctx; + + TRACE_ENTER(QMUX_EV_QCC_END, qcc->conn); + qc_release(qcc); + TRACE_LEAVE(QMUX_EV_QCC_END); +} + static void qc_detach(struct conn_stream *cs) { struct qcs *qcs = __cs_mux(cs); @@ -1346,6 +1355,7 @@ INITCALL0(STG_INIT, qmux_init_stdout_traces); static const struct mux_ops qc_ops = { .init = qc_init, + .destroy = qc_destroy, .detach = qc_detach, .rcv_buf = qc_rcv_buf, .snd_buf = qc_snd_buf,