From: Willy Tarreau Date: Fri, 3 Sep 2021 08:58:07 +0000 (+0200) Subject: BUG/MEDIUM: vars: run over the correct list in release_store_rules() X-Git-Tag: v2.5-dev6~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c77bad24671bd92445d78db6667be47b201ee3dd;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: vars: run over the correct list in release_store_rules() In commit 9a621ae76 ("MEDIUM: vars: add a new "set-var-fmt" action") we introduced the support for format strings in variables with the ability to release them on exit, except that it's the wrong list that was being scanned for the rule (http vs vars), resulting in random crashes during deinit. This was a recent commit in 2.5-dev, no backport is needed. --- diff --git a/src/vars.c b/src/vars.c index bf53d87109..85c6fc4bdd 100644 --- a/src/vars.c +++ b/src/vars.c @@ -724,7 +724,8 @@ static enum act_return action_clear(struct act_rule *rule, struct proxy *px, static void release_store_rule(struct act_rule *rule) { struct logformat_node *lf, *lfb; - list_for_each_entry_safe(lf, lfb, &rule->arg.http.fmt, list) { + + list_for_each_entry_safe(lf, lfb, &rule->arg.vars.fmt, list) { LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg);