]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: tcp-rules: completely free incorrect TCP rules on error
authorWilly Tarreau <w@1wt.eu>
Thu, 17 Mar 2022 19:26:54 +0000 (20:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 17 Mar 2022 19:26:54 +0000 (20:26 +0100)
When a tcp-request or tcp-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. Reg-tests are now completely OK with ASAN. 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/tcp_rules.c

index 82c1c5910f75a294485989b982052bfc785c319e..e4c7647ea270b0e7763cc3140eaa1c99e7f28b2a 100644 (file)
@@ -1192,7 +1192,7 @@ static int tcp_parse_tcp_rep(char **args, int section_type, struct proxy *curpx,
 
        return warn;
  error:
-       free(rule);
+       free_act_rule(rule);
        return -1;
 }
 
@@ -1406,7 +1406,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx,
 
        return warn;
  error:
-       free(rule);
+       free_act_rule(rule);
        return -1;
 }