Skip to content

Commit

Permalink
BUG/MINOR: proxy: also make the cli and resolvers use the global name
Browse files Browse the repository at this point in the history
As detected by ASAN on the CI, two places still using strdup() on the
proxy names were left by commit b325453 ("MINOR: proxy: use the global
file names for conf->file").

No backport is needed.
  • Loading branch information
wtarreau committed Sep 21, 2024
1 parent b500e84 commit fdf38ed
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/sink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fdf38ed

Please sign in to comment.