]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC DEMUX: Refactor list manipulation
authorHugo Landau <hlandau@openssl.org>
Wed, 30 Nov 2022 08:50:58 +0000 (08:50 +0000)
committerHugo Landau <hlandau@openssl.org>
Thu, 19 Jan 2023 13:17:40 +0000 (13:17 +0000)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19734)

ssl/quic/quic_demux.c

index b2afe73062f391a39387d73aeca705373c508125..fabbf6cb7ee25973b393d6b804198dc4a36a6e1d 100644 (file)
@@ -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;
         }