From 2c701dbc0764157aa74dd90ed9a4c1133ddce97b Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 26 Jan 2023 15:32:12 +0100 Subject: [PATCH] BUG/MINOR: log: release global log servers on exit Since 2.6 we have a free_logsrv() function that is used to release log servers. It must be called from deinit() instead of manually iterating over the log servers, otherwise some parts of the structure are not freed (namely the ring name), as reported by ASAN. This should be backported to 2.6. --- src/haproxy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/haproxy.c b/src/haproxy.c index e0b48a7..3cf57e4 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2823,10 +2823,10 @@ void deinit(void) idle_conn_task = NULL; list_for_each_entry_safe(log, logb, &global.logsrvs, list) { - LIST_DELETE(&log->list); - free(log->conf.file); - free(log); - } + LIST_DEL_INIT(&log->list); + free_logsrv(log); + } + list_for_each_entry_safe(wl, wlb, &cfg_cfgfiles, list) { free(wl->s); LIST_DELETE(&wl->list); -- 1.7.10.4