From: Willy Tarreau Date: Thu, 2 Feb 2012 16:06:13 +0000 (+0100) Subject: BUG: fix double free in peers config error path X-Git-Tag: v1.5-dev8~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f9b003c2b6f885c7bda8a4cdc88404b05e19b61;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 4fed92e80b..6fa549a37d 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -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++; }