BUG: fix double free in peers config error path

If the local host is not found as a peer in a "peers" section, we have a
double free, and possibly a use-after-free because the peers section is
freed since it's aliased as the table's name.
This commit is contained in:
Willy Tarreau 2012-02-02 17:06:13 +01:00
parent b7aeec6333
commit 6f9b003c2b

View file

@ -5931,7 +5931,6 @@ int check_config_validity()
else if (!curpeers->peers_fe) {
Alert("Proxy '%s': unable to find local peer '%s' in peers section '%s'.\n",
curproxy->id, localpeer, curpeers->id);
free((void *)curproxy->table.peers.name);
curproxy->table.peers.p = NULL;
cfgerr++;
}