BUG/MINOR: proxy: also make the cli and resolvers use the global name

As detected by ASAN on the CI, two places still using strdup() on the
proxy names were left by commit b325453c3 ("MINOR: proxy: use the global
file names for conf->file").

No backport is needed.
This commit is contained in:
Willy Tarreau 2024-09-21 20:08:06 +02:00
parent b500e84e24
commit fdf38ed7fc
2 changed files with 2 additions and 2 deletions

View File

@ -460,7 +460,7 @@ static struct proxy *cli_alloc_fe(const char *name, const char *file, int line)
fe->cap = PR_CAP_FE|PR_CAP_INT;
fe->maxconn = 10; /* default to 10 concurrent connections */
fe->timeout.client = MS_TO_TICKS(10000); /* default timeout of 10 seconds */
fe->conf.file = strdup(file);
fe->conf.file = copy_file_name(file);
fe->conf.line = line;
fe->accept = frontend_accept;
fe->default_target = &cli_applet.obj_type;

View File

@ -757,7 +757,7 @@ static struct sink *sink_new_ringbuf(const char *id, const char *description,
init_new_proxy(p);
sink_setup_proxy(p);
p->id = strdup(id);
p->conf.args.file = p->conf.file = strdup(file);
p->conf.args.file = p->conf.file = copy_file_name(file);
p->conf.args.line = p->conf.line = linenum;
sink = sink_new_buf(id, description, LOG_FORMAT_RAW, BUFSIZE);