]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: release global log servers on exit
authorWilly Tarreau <w@1wt.eu>
Thu, 26 Jan 2023 14:32:12 +0000 (15:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 26 Jan 2023 14:49:30 +0000 (15:49 +0100)
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

index e0b48a752d48cbc46fad2f12744fbe85c1ad2c11..3cf57e4a4b0a455196906ae359dbdea568119ece 100644 (file)
@@ -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);