MINOR: proxy: also store the name for a defaults section

There's an optional name, but till now it was not even saved into the
structure, let's keep it.
This commit is contained in:
Willy Tarreau 2021-02-12 13:33:03 +01:00
parent ab3410c65d
commit c02ab03142
2 changed files with 2 additions and 0 deletions

View file

@ -261,6 +261,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
init_new_proxy(curr_defproxy);
proxy_preset_defaults(curr_defproxy);
curproxy = curr_defproxy;
curproxy->id = strdup(args[1]); // may be empty
curproxy->conf.args.file = curproxy->conf.file = strdup(file);
curproxy->conf.args.line = curproxy->conf.line = linenum;
defproxy.cap = PR_CAP_DEF | PR_CAP_LISTEN; /* all caps for now */

View file

@ -1111,6 +1111,7 @@ void proxy_preset_defaults(struct proxy *defproxy)
*/
void proxy_free_defaults(struct proxy *defproxy)
{
free(defproxy->id); defproxy->id = NULL;
free(defproxy->conf.file); defproxy->conf.file = NULL;
free(defproxy->check_command); defproxy->check_command = NULL;
free(defproxy->check_path); defproxy->check_path = NULL;