From 2461bd534a1639775b2264a2f307e9684a912fc0 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Wed, 13 Apr 2022 16:54:52 +0200 Subject: [PATCH] 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. --- src/mux_quic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mux_quic.c b/src/mux_quic.c index 58e4759d0..a4ffe97c7 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, -- 2.47.3