diff --git a/include/haproxy/mux_quic.h b/include/haproxy/mux_quic.h index 14de1e061..908a02fba 100644 --- a/include/haproxy/mux_quic.h +++ b/include/haproxy/mux_quic.h @@ -120,7 +120,7 @@ static inline struct stconn *qc_attach_sc(struct qcs *qcs, struct buffer *buf) * it to sedesc. See for more info. */ BUG_ON_HOT(!LIST_INLIST(&qcs->el_opening)); - LIST_DELETE(&qcs->el_opening); + LIST_DEL_INIT(&qcs->el_opening); return qcs->sd->sc; } diff --git a/src/mux_quic.c b/src/mux_quic.c index 0c716bb26..8e48493d0 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -59,8 +59,8 @@ static void qcs_free(struct qcs *qcs) TRACE_ENTER(QMUX_EV_QCS_END, qcc->conn, qcs); - if (LIST_INLIST(&qcs->el_opening)) - LIST_DELETE(&qcs->el_opening); + /* Safe to use even if already removed from the list. */ + LIST_DEL_INIT(&qcs->el_opening); /* Release stream endpoint descriptor. */ BUG_ON(qcs->sd && !se_fl_test(qcs->sd, SE_FL_ORPHAN));