From dd7e6c6dc7d65c8fb0c77bfbf4d12b01b792295c Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 17 Mar 2022 20:29:06 +0100 Subject: [PATCH] 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. --- src/http_rules.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; } -- 2.39.5