mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
BUG/MINOR: flt-trace: Support only one name option
When a trace filter is defined, only one 'name' option is expected. But it was not tested. Thus it was possible to set several names leading to a memory leak. It is now tested, and it is not allowed to redefine the trace filter name. It was reported by Coverity in #2841: CID 1587768. This patch could be backported to all stable versions.
This commit is contained in:
parent
a7f513af91
commit
b20e2c96cf
@ -631,6 +631,11 @@ parse_trace_flt(char **args, int *cur_arg, struct proxy *px,
|
||||
args[*cur_arg], args[pos]);
|
||||
goto error;
|
||||
}
|
||||
if (conf->name) {
|
||||
memprintf(err, "'%s' : '%s' option already defined",
|
||||
args[*cur_arg], args[pos]);
|
||||
goto error;
|
||||
}
|
||||
conf->name = strdup(args[pos + 1]);
|
||||
if (!conf->name) {
|
||||
memprintf(err, "%s: out of memory", args[*cur_arg]);
|
||||
|
Loading…
Reference in New Issue
Block a user