Skip to content

Commit 4b596c1

Browse files
committed
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.
1 parent cbfe574 commit 4b596c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/server.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3211,6 +3211,7 @@ void srv_free_params(struct server *srv)
32113211
struct server *srv_drop(struct server *srv)
32123212
{
32133213
struct server *next = NULL;
3214+
int i __maybe_unused;
32143215

32153216
if (!srv)
32163217
goto end;
@@ -3239,6 +3240,10 @@ struct server *srv_drop(struct server *srv)
32393240
task_destroy(srv->srvrq_check);
32403241

32413242
free(srv->id);
3243+
#ifdef USE_QUIC
3244+
for (i = 0; i < global.nbthread; i++)
3245+
istfree(&srv->per_thr[i].quic_retry_token);
3246+
#endif
32423247
srv_free_params(srv);
32433248

32443249
HA_SPIN_DESTROY(&srv->lock);

0 commit comments

Comments
 (0)