CLEANUP: stick-table: make the file location point to a global file name

The file name used to point to the calling function's stack for stick
tables, which was OK during parsing but remained dangling afterwards.
At least it was already marked const so as not to accidentally free it.
Let's make it point to a file_name_node now.
This commit is contained in:
Willy Tarreau 2024-09-19 15:06:09 +02:00
parent d6c060c5ae
commit 9ab21a3c2d
2 changed files with 2 additions and 2 deletions

View File

@ -224,7 +224,7 @@ struct stktable {
/* rarely used config stuff below (should not interfere with updt_lock) */
struct proxy *proxies_list; /* The list of proxies which reference this stick-table. */
struct {
const char *file; /* The file where the stick-table is declared. */
const char *file; /* The file where the stick-table is declared (global name). */
int line; /* The line in this <file> the stick-table is declared. */
} conf;
};

View File

@ -1181,7 +1181,7 @@ int parse_stick_table(const char *file, int linenum, char **args,
t->idlen = strlen(id);
t->nid = nid;
t->type = (unsigned int)-1;
t->conf.file = file;
t->conf.file = copy_file_name(file);
t->conf.line = linenum;
t->write_to.name = NULL;
t->brates_factor = 1;