From c3d01347cc06179a1f126e7e772a2b41b477b2ba Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 27 Apr 2020 11:17:10 +0200 Subject: [PATCH] BUG/MINOR: server: Fix server_finalize_init() to avoid unused variable The variable 'ret' must only be declared When HAProxy is compiled with the SSL support (more precisely SSL_CTRL_SET_TLSEXT_HOSTNAME must be defined). No backport needed. (cherry picked from commit b3b53524addbea79f5928b0bd5c58fd201a3e828) Signed-off-by: Christopher Faulet [Cf: The patch fixes a bug introduced by the commit 8892e5d3. Thus it must be backported to the same versions.] --- src/server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server.c b/src/server.c index 380339c..7d44921 100644 --- a/src/server.c +++ b/src/server.c @@ -1896,7 +1896,9 @@ static int server_sni_expr_init(const char *file, int linenum, char **args, int static int server_finalize_init(const char *file, int linenum, char **args, int cur_arg, struct server *srv, struct proxy *px) { +#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME int ret; +#endif if (srv->do_check && srv->trackit) { ha_alert("parsing [%s:%d]: unable to enable checks and tracking at the same time!\n", -- 1.7.10.4