diff --git a/ssl/quic/quic_demux.c b/ssl/quic/quic_demux.c index b2afe73062..fabbf6cb7e 100644 --- a/ssl/quic/quic_demux.c +++ b/ssl/quic/quic_demux.c @@ -501,14 +501,13 @@ static int demux_process_pending_urxe(QUIC_DEMUX *demux, QUIC_URXE *e) * handler, pass it to the handler. Otherwise, we will never be able to * process this datagram, so get rid of it. */ + ossl_list_urxe_remove(&demux->urx_pending, e); if (demux->default_cb != NULL) { /* Pass to default handler. */ - ossl_list_urxe_remove(&demux->urx_pending, e); e->demux_state = URXE_DEMUX_STATE_ISSUED; demux->default_cb(e, demux->default_cb_arg); } else { /* Discard. */ - ossl_list_urxe_remove(&demux->urx_pending, e); ossl_list_urxe_insert_tail(&demux->urx_free, e); e->demux_state = URXE_DEMUX_STATE_FREE; }