From 4b596c1ea897edb6984b66997bd3d2d982c09488 Mon Sep 17 00:00:00 2001 From: Amaury Denoyelle Date: Mon, 24 Nov 2025 14:25:14 +0100 Subject: [PATCH] BUG/MINOR: quic/server: free quic_retry_token on srv drop A recent patch has implemented caching of QUIC token received from a NEW_TOKEN frame into the server cache. This value is stored per thread into a field. This field is an ist, first set to an empty string. Via qc_try_store_new_token(), it is reallocated to fit the size of the newly stored token. Prior to this patch, the field was never freed so this causes a memory leak. Fix this by using istfree() on field during srv_drop(). No need to backport. --- src/server.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server.c b/src/server.c index 1b3061487..f92449219 100644 --- a/src/server.c +++ b/src/server.c @@ -3211,6 +3211,7 @@ void srv_free_params(struct server *srv) struct server *srv_drop(struct server *srv) { struct server *next = NULL; + int i __maybe_unused; if (!srv) goto end; @@ -3239,6 +3240,10 @@ struct server *srv_drop(struct server *srv) task_destroy(srv->srvrq_check); free(srv->id); +#ifdef USE_QUIC + for (i = 0; i < global.nbthread; i++) + istfree(&srv->per_thr[i].quic_retry_token); +#endif srv_free_params(srv); HA_SPIN_DESTROY(&srv->lock);