From: Willy Tarreau Date: Thu, 17 Mar 2022 19:29:06 +0000 (+0100) Subject: BUG/MINOR: http-rules: completely free incorrect TCP rules on error X-Git-Tag: v2.6-dev4~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd7e6c6dc7d65c8fb0c77bfbf4d12b01b792295c;p=thirdparty%2Fhaproxy.git BUG/MINOR: http-rules: completely free incorrect TCP rules on error When a http-request or http-response rule fails to parse, we currently free only the rule without its contents, which makes ASAN complain. Now that we have a new function for this, let's completely free the rule. This relies on this commit: MINOR: actions: add new function free_act_rule() to free a single rule It's probably not needed to backport this since we're on the exit path anyway. --- diff --git a/src/http_rules.c b/src/http_rules.c index 2ed9dfc70d..9314d5aa71 100644 --- a/src/http_rules.c +++ b/src/http_rules.c @@ -163,7 +163,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li return rule; out_err: - free(rule); + free_act_rule(rule); return NULL; } @@ -241,7 +241,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li return rule; out_err: - free(rule); + free_act_rule(rule); return NULL; } @@ -310,7 +310,7 @@ struct act_rule *parse_http_after_res_cond(const char **args, const char *file, return rule; out_err: - free(rule); + free_act_rule(rule); return NULL; }