From 9075dbdd84efa4c5066c5cc8c3f0c4945c3ee832 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 21 Mar 2022 07:55:34 +0100 Subject: [PATCH] BUG/MINOR: rules: Initialize the list element when allocating a new rule dd7e6c6dc ("BUG/MINOR: http-rules: completely free incorrect TCP rules on error") and 388c0f2a6 ("BUG/MINOR: tcp-rules: completely free incorrect TCP rules on error") introduced a regression because the list element of a new rule is not intialized. Thus HAProxy crashes when an incorrect rule is released. This patch must be backported if above commits are backported. Note that new_act_rule() only exists since the 2.5. It relies on the commit d535f807b ("MINOR: rules: add a new function new_act_rule() to allocate act_rules"). --- src/action.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/action.c b/src/action.c index d4aecc8c0..74f5387b9 100644 --- a/src/action.c +++ b/src/action.c @@ -298,6 +298,7 @@ struct act_rule *new_act_rule(enum act_from from, const char *file, int linenum) rule->from = from; rule->conf.file = file ? strdup(file) : NULL; rule->conf.line = linenum; + LIST_INIT(&rule->list); return rule; }