CLEANUP: haproxy: Free per_thread_*_list in deinit()

This allocation is technically always reachable and cannot leak, but so are
a few others that *are* freed.
This commit is contained in:
Tim Duesterhus 2020-09-10 19:46:41 +02:00 committed by Willy Tarreau
parent 53508d6564
commit f0c25d210c

View File

@ -2402,6 +2402,10 @@ void deinit(void)
struct post_deinit_fct *pdf, *pdfb;
struct proxy_deinit_fct *pxdf, *pxdfb;
struct server_deinit_fct *srvdf, *srvdfb;
struct per_thread_init_fct *tif, *tifb;
struct per_thread_deinit_fct *tdf, *tdfb;
struct per_thread_alloc_fct *taf, *tafb;
struct per_thread_free_fct *tff, *tffb;
struct post_server_check_fct *pscf, *pscfb;
struct post_proxy_check_fct *ppcf, *ppcfb;
@ -2728,6 +2732,26 @@ void deinit(void)
free(ppcf);
}
list_for_each_entry_safe(tif, tifb, &per_thread_init_list, list) {
LIST_DEL(&tif->list);
free(tif);
}
list_for_each_entry_safe(tdf, tdfb, &per_thread_deinit_list, list) {
LIST_DEL(&tdf->list);
free(tdf);
}
list_for_each_entry_safe(taf, tafb, &per_thread_alloc_list, list) {
LIST_DEL(&taf->list);
free(taf);
}
list_for_each_entry_safe(tff, tffb, &per_thread_free_list, list) {
LIST_DEL(&tff->list);
free(tff);
}
vars_prune(&global.vars, NULL, NULL);
pool_destroy_all();
deinit_pollers();