From 8b9a2df969a38373328e0ad44ce8f0f8ea62c051 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Wed, 4 May 2022 14:29:46 +0200 Subject: [PATCH] MINOR: init: exit() after pre-check upon error Add a test on the err_code variable so we don't go further if one of the pre-check callback failed. --- src/haproxy.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/haproxy.c b/src/haproxy.c index 02690edb7..ec40a6427 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2117,6 +2117,11 @@ static void init(int argc, char **argv) list_for_each_entry(prcf, &pre_check_list, list) err_code |= prcf->fct(); + if (err_code & (ERR_ABORT|ERR_FATAL)) { + ha_alert("Fatal errors found in configuration.\n"); + exit(1); + } + err_code |= check_config_validity(); for (px = proxies_list; px; px = px->next) { struct server *srv;