]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: quic: Release asap quic_conn memory (application level)
authorFrédéric Lécaille <flecaille@haproxy.com>
Tue, 8 Aug 2023 08:47:11 +0000 (10:47 +0200)
committerFrédéric Lécaille <flecaille@haproxy.com>
Tue, 8 Aug 2023 12:59:17 +0000 (14:59 +0200)
Add a check to the QUIC packet handler running at application level (after the
handshake is complete) to release the quic_conn memory calling quic_conn_release().
This is done only if the mux is not started.

src/quic_conn.c

index 3ed409f7a8d1155748d871b108f350aac526df52..c0c128a462cf001d2216be34688edec6e09a63c1 100644 (file)
@@ -743,6 +743,11 @@ struct task *quic_conn_app_io_cb(struct task *t, void *context, unsigned int sta
        }
 
  out:
+       if ((qc->flags & QUIC_FL_CONN_CLOSING) && qc->mux_state != QC_MUX_READY) {
+               quic_conn_release(qc);
+               qc = NULL;
+       }
+
        TRACE_LEAVE(QUIC_EV_CONN_IO_CB, qc);
        return t;
 }