]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: sample: free err2 in smp_resolve_args for type ARGT_REG
authorDragan Dosen <ddosen@haproxy.com>
Thu, 17 Oct 2024 20:57:06 +0000 (22:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Oct 2024 12:29:56 +0000 (14:29 +0200)
The err2 may be leaking memory in case an error occurred as a result of
regex_comp() call.

src/sample.c

index 1951d7b6b85882b52dfca2cd09d2060f65356e0d..67531392ac959925af2817edacc9d9841e666005 100644 (file)
@@ -1638,6 +1638,7 @@ int smp_resolve_args(struct proxy *p, char **err)
                                          *err ? *err : "", cur->file, cur->line,
                                         arg->data.str.area,
                                         cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id, err2);
+                               ha_free(&err2);
                                cfgerr++;
                                continue;
                        }