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 <quic_retry_token> 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 <quic_retry_token> field during
srv_drop().

No need to backport.
This commit is contained in:
Amaury Denoyelle 2025-11-24 14:25:14 +01:00
parent cbfe574d8a
commit 4b596c1ea8

View File

@ -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);