]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG: fix double free in peers config error path
authorWilly Tarreau <w@1wt.eu>
Thu, 2 Feb 2012 16:06:13 +0000 (17:06 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 Feb 2012 16:53:37 +0000 (17:53 +0100)
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.

src/cfgparse.c

index 4fed92e80b13b01ea03283599e1bb1c3e64beea4..6fa549a37df88770db3e160c55af4eabeac3f507 100644 (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++;
                        }