diff --git a/src/mux_quic.c b/src/mux_quic.c index 68b913970..98438a7a1 100644 --- a/src/mux_quic.c +++ b/src/mux_quic.c @@ -2616,9 +2616,11 @@ static int qcc_emit_fctl(struct qcc *qcc) LIST_APPEND(&single_frm, &frm->list); if (qcc_send_frames(qcc, &single_frm, 0)) { - /* replace frame that cannot be sent in qcc list. */ - LIST_DELETE(&frm->list); - LIST_INSERT(&qcc->lfctl.frms, &frm->list); + if (!LIST_ISEMPTY(&single_frm)) { + /* replace frame that cannot be sent in qcc list. */ + LIST_DELETE(&frm->list); + LIST_INSERT(&qcc->lfctl.frms, &frm->list); + } goto err; } @@ -2626,7 +2628,7 @@ static int qcc_emit_fctl(struct qcc *qcc) /* If frame is MAX_STREAM_DATA, reset corresponding QCS msd_frm pointer. */ if (id >= 0) { - node = eb64_lookup(&qcc->streams_by_id, frm->max_stream_data.id); + node = eb64_lookup(&qcc->streams_by_id, id); if (node) { qcs = eb64_entry(node, struct qcs, by_id); qcs->tx.msd_frm = NULL;