From fdf38ed7fc3c0c6e6c95a5cef4bda8cc7dadfb66 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 21 Sep 2024 20:08:06 +0200 Subject: [PATCH] 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. --- src/cli.c | 2 +- src/sink.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli.c b/src/cli.c index 5d8e7ae91..01a7216f0 100644 --- a/src/cli.c +++ b/src/cli.c @@ -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; diff --git a/src/sink.c b/src/sink.c index db98fcebc..711233793 100644 --- a/src/sink.c +++ b/src/sink.c @@ -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);