mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
BUG/MINOR: fix a segfault when parsing a config with undeclared peers
Baptiste Assmann reported that a config where a non-existing peers section is referenced by a stick-table causes a segfault after displaying the error. This is caused by the freeing of the peers. Setting it to NULL after displaying the error fixes the issue.
This commit is contained in:
parent
ac1932da3e
commit
d66bf96d5b
@ -5884,11 +5884,15 @@ int check_config_validity()
|
|||||||
if (!curpeers) {
|
if (!curpeers) {
|
||||||
Alert("Proxy '%s': unable to find sync peers '%s'.\n",
|
Alert("Proxy '%s': unable to find sync peers '%s'.\n",
|
||||||
curproxy->id, curproxy->table.peers.name);
|
curproxy->id, curproxy->table.peers.name);
|
||||||
|
free((void *)curproxy->table.peers.name);
|
||||||
|
curproxy->table.peers.p = NULL;
|
||||||
cfgerr++;
|
cfgerr++;
|
||||||
}
|
}
|
||||||
else if (!curpeers->peers_fe) {
|
else if (!curpeers->peers_fe) {
|
||||||
Alert("Proxy '%s': unable to find local peer '%s' in peers section '%s'.\n",
|
Alert("Proxy '%s': unable to find local peer '%s' in peers section '%s'.\n",
|
||||||
curproxy->id, localpeer, curpeers->id);
|
curproxy->id, localpeer, curpeers->id);
|
||||||
|
free((void *)curproxy->table.peers.name);
|
||||||
|
curproxy->table.peers.p = NULL;
|
||||||
cfgerr++;
|
cfgerr++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user