A recent patch has introduced free operation for QUIC tokens stored in a
server. These values are located in <per_thr> server array.
However, a server instance may be released prior to its full
initialization in case of a failure during "add server" CLI command. The
mentionned patch would cause a srv_drop() crash due to an invalid usage
of NULL <per_thr> member.
Fix this by adding a check on <per_thr> prior to dereference it in
srv_drop().
No need to backport.
free(srv->id);
#ifdef USE_QUIC
- for (i = 0; i < global.nbthread; i++)
- istfree(&srv->per_thr[i].quic_retry_token);
+ if (srv->per_thr) {
+ for (i = 0; i < global.nbthread; i++)
+ istfree(&srv->per_thr[i].quic_retry_token);
+ }
#endif
srv_free_params(srv);