From: Daniel Corbett Date: Wed, 9 Jan 2019 13:13:29 +0000 (-0500) Subject: BUG/MEDIUM: init: Initialize idle_orphan_conns for first server in server-template X-Git-Tag: v2.0-dev1~233 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43bb842a08a6b772f1d76ff481d5555a8c871dcd;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: init: Initialize idle_orphan_conns for first server in server-template When initializing server-template all of the servers after the first have srv->idle_orphan_conns initialized within server_template_init() The first server does not have this initialized and when http-reuse is active this causes a segmentation fault when accessed from srv_add_to_idle_list(). This patch removes the check for srv->tmpl_info.prefix within server_finalize_init() and allows the first server within a server-template to have srv->idle_orphan_conns properly initialized. This should be backported to 1.9. --- diff --git a/src/server.c b/src/server.c index 4cd87849d8..bc9e805282 100644 --- a/src/server.c +++ b/src/server.c @@ -1936,7 +1936,7 @@ static int server_finalize_init(const char *file, int linenum, char **args, int px->srv_act++; srv_lb_commit_status(srv); - if (!srv->tmpl_info.prefix && srv->max_idle_conns != 0) { + if (srv->max_idle_conns != 0) { int i; srv->idle_orphan_conns = calloc(global.nbthread, sizeof(*srv->idle_orphan_conns));