diff --git a/include/common/cfgparse.h b/include/common/cfgparse.h index 86a003514..d78532771 100644 --- a/include/common/cfgparse.h +++ b/include/common/cfgparse.h @@ -73,6 +73,7 @@ int check_config_validity(); int str2listener(char *str, struct proxy *curproxy, struct bind_conf *bind_conf, const char *file, int line, char **err); int cfg_register_section(char *section_name, int (*section_parser)(const char *, int, char **, int)); +void cfg_unregister_sections(void); int warnif_misplaced_tcp_conn(struct proxy *proxy, const char *file, int line, const char *arg); int warnif_misplaced_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg); diff --git a/src/cfgparse.c b/src/cfgparse.c index d732ac328..b40588fb6 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -8846,6 +8846,19 @@ int cfg_register_section(char *section_name, return 1; } +/* + * free all config section entries + */ +void cfg_unregister_sections(void) +{ + struct cfg_section *cs, *ics; + + list_for_each_entry_safe(cs, ics, §ions, list) { + LIST_DEL(&cs->list); + free(cs); + } +} + /* * Local variables: * c-indent-level: 8