MINOR: cfgparse: New function cfg_unregister_sections()

A new function introduced meant to be called during general deinit phase.
During the configuration parsing, the section entries are all allocated.
This new function free them.
This commit is contained in:
David Carlier 2015-09-25 11:49:18 +01:00 committed by Willy Tarreau
parent 270978492c
commit 845efb53c7
2 changed files with 14 additions and 0 deletions

View File

@ -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);

View File

@ -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, &sections, list) {
LIST_DEL(&cs->list);
free(cs);
}
}
/*
* Local variables:
* c-indent-level: 8