mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-22 12:30:07 +00:00
BUG/MINOR: stktable: missing free in parse_stick_table()
When "peers" keyword is encountered within a stick table definition, peers.name hint gets replaced with a new copy of the provided name using strdup(). However, there is no detection on whether the name was previously set or not, so it is currently allowed to reuse the keyword multiple time to overwrite previous value, but here we forgot to free previous value for peers.name before assigning it to a new one. This should be backported to every stable versions.
This commit is contained in:
parent
b9c0b039c8
commit
6376fe9142
@ -995,6 +995,7 @@ int parse_stick_table(const char *file, int linenum, char **args,
|
||||
err_code |= ERR_ALERT | ERR_FATAL;
|
||||
goto out;
|
||||
}
|
||||
ha_free(&t->peers.name);
|
||||
t->peers.name = strdup(args[idx++]);
|
||||
}
|
||||
else if (strcmp(args[idx], "expire") == 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user