]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: haproxy: Free server_deinit_list in deinit()
authorTim Duesterhus <tim@bastelstu.be>
Sat, 4 Jul 2020 09:49:49 +0000 (11:49 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jul 2020 14:52:35 +0000 (16:52 +0200)
This allocation is technically always reachable and cannot leak, but so are
a few others that *are* freed.

src/haproxy.c

index 88a1c9752fba2f96eedab4f4b2318d92a568c483..596595699bc00a854be40344061e00b52bcac0c5 100644 (file)
@@ -2606,7 +2606,7 @@ void deinit(void)
        struct build_opts_str *bol, *bolb;
        struct post_deinit_fct *pdf, *pdfb;
        struct proxy_deinit_fct *pxdf, *pxdfb;
-       struct server_deinit_fct *srvdf;
+       struct server_deinit_fct *srvdf, *srvdfb;
 
        deinit_signals();
        while (p) {
@@ -2902,6 +2902,11 @@ void deinit(void)
                free(pdf);
        }
 
+       list_for_each_entry_safe(srvdf, srvdfb, &server_deinit_list, list) {
+               LIST_DEL(&srvdf->list);
+               free(srvdf);
+       }
+
        vars_prune(&global.vars, NULL, NULL);
        pool_destroy_all();
        deinit_pollers();