diff --git a/src/cfgparse.c b/src/cfgparse.c index eaa853f6e1..2c80083120 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -3925,6 +3925,7 @@ out_uri_auth_compat: */ last = &cfg_peers; while (*last) { + struct stktable *t; curpeers = *last; if (curpeers->state == PR_STSTOPPED) { @@ -3936,6 +3937,9 @@ out_uri_auth_compat: else if (!curpeers->peers_fe || !curpeers->peers_fe->id) { ha_warning("Removing incomplete section 'peers %s' (no peer named '%s').\n", curpeers->id, localpeer); + if (curpeers->peers_fe) + stop_proxy(curpeers->peers_fe); + curpeers->peers_fe = NULL; } else if (atleast2(curpeers->peers_fe->bind_proc)) { /* either it's totally stopped or too much used */ @@ -3998,6 +4002,11 @@ out_uri_auth_compat: */ free(curpeers->id); curpeers = curpeers->next; + /* Reset any refereance to this peers section in the list of stick-tables */ + for (t = stktables_list; t; t = t->next) { + if (t->peers.p && t->peers.p == *last) + t->peers.p = NULL; + } free(*last); *last = curpeers; }