From: Willy Tarreau Date: Wed, 27 Apr 2022 16:07:24 +0000 (+0200) Subject: CLEANUP: deinit: release the config postparsers X-Git-Tag: v2.6-dev8~51 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=226866e1bbb0c971dbf08967f876b1ef2be07c2c;p=thirdparty%2Fhaproxy.git CLEANUP: deinit: release the config postparsers These ones were not released either, it just requires to export the list ("postparsers") and it makes valgrind happy. --- diff --git a/include/haproxy/cfgparse.h b/include/haproxy/cfgparse.h index 2708f7685c..7c3d128bfb 100644 --- a/include/haproxy/cfgparse.h +++ b/include/haproxy/cfgparse.h @@ -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; diff --git a/src/haproxy.c b/src/haproxy.c index 4ae694e8c2..02690edb7b 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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();