]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: proxy: also make the cli and resolvers use the global name
authorWilly Tarreau <w@1wt.eu>
Sat, 21 Sep 2024 18:08:06 +0000 (20:08 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 21 Sep 2024 18:08:06 +0000 (20:08 +0200)
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
src/sink.c

index 5d8e7ae91987ff1a21b5c7eeba1e1a4ef56a270a..01a7216f09b8e5c32169cfc403fe03cc9c7b9c1c 100644 (file)
--- 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;
index db98fcebc887c938c41c75186567ae5e8d7ac253..711233793f7e4b76873f5dab5b2d7c92b28e2c30 100644 (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);