]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: http-rules: completely free incorrect TCP rules on error
authorWilly Tarreau <w@1wt.eu>
Thu, 17 Mar 2022 19:29:06 +0000 (20:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Mar 2022 19:29:06 +0000 (20:29 +0100)
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

index 2ed9dfc70d00587517a9b27efa14b9b6ceb32396..9314d5aa71d5482761127c4f4c127fbfe14e043c 100644 (file)
@@ -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;
 }