]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: deinit: release the config postparsers
authorWilly Tarreau <w@1wt.eu>
Wed, 27 Apr 2022 16:07:24 +0000 (18:07 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 27 Apr 2022 16:07:24 +0000 (18:07 +0200)
These ones were not released either, it just requires to export the list
("postparsers") and it makes valgrind happy.

include/haproxy/cfgparse.h
src/haproxy.c

index 2708f7685ca5c1e7b47479d05a4ded1038435ded..7c3d128bfb8fc54fd5558c6603eb6967def504ac 100644 (file)
@@ -88,6 +88,7 @@ struct cfg_postparser {
        int (*func)();
 };
 
+extern struct list postparsers;
 extern int cfg_maxpconn;
 extern int cfg_maxconn;
 extern char *cfg_scope;
index 4ae694e8c25ee044c4b2236a5724e49fd40dca8a..02690edb7b7a74a508faf42f80ee04a90cb9a5c5 100644 (file)
@@ -2558,6 +2558,7 @@ void deinit(void)
        struct post_check_fct *pcf, *pcfb;
        struct post_proxy_check_fct *ppcf, *ppcfb;
        struct pre_check_fct *prcf, *prcfb;
+       struct cfg_postparser *pprs, *pprsb;
        int cur_fd;
 
        /* At this point the listeners state is weird:
@@ -2738,6 +2739,11 @@ void deinit(void)
                free(tff);
        }
 
+       list_for_each_entry_safe(pprs, pprsb, &postparsers, list) {
+               LIST_DELETE(&pprs->list);
+               free(pprs);
+       }
+
        vars_prune(&proc_vars, NULL, NULL);
        pool_destroy_all();
        deinit_pollers();