mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
MINOR: regex: fix a little configuration memory leak.
The function regfree free the memory allocated to the pattern buffer by the compiling process. It is not freeing the buffer itself.
This commit is contained in:
parent
75ab8bdb83
commit
148f40866b
@ -2118,7 +2118,11 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
||||
free(defproxy.server_id_hdr_name);
|
||||
defproxy.server_id_hdr_len = 0;
|
||||
free(defproxy.expect_str);
|
||||
if (defproxy.expect_regex) regfree(defproxy.expect_regex);
|
||||
if (defproxy.expect_regex) {
|
||||
regfree(defproxy.expect_regex);
|
||||
free(defproxy.expect_regex);
|
||||
defproxy.expect_regex = NULL;
|
||||
}
|
||||
|
||||
if (defproxy.conf.logformat_string != default_http_log_format &&
|
||||
defproxy.conf.logformat_string != default_tcp_log_format &&
|
||||
@ -4208,7 +4212,11 @@ stats_error_parsing:
|
||||
}
|
||||
curproxy->options2 |= PR_O2_EXP_RSTS;
|
||||
free(curproxy->expect_str);
|
||||
if (curproxy->expect_regex) regfree(curproxy->expect_regex);
|
||||
if (curproxy->expect_regex) {
|
||||
regfree(curproxy->expect_regex);
|
||||
free(curproxy->expect_regex);
|
||||
curproxy->expect_regex = NULL;
|
||||
}
|
||||
curproxy->expect_str = strdup(args[cur_arg + 1]);
|
||||
curproxy->expect_regex = calloc(1, sizeof(regex_t));
|
||||
if (regcomp(curproxy->expect_regex, args[cur_arg + 1], REG_EXTENDED) != 0) {
|
||||
@ -4227,7 +4235,11 @@ stats_error_parsing:
|
||||
}
|
||||
curproxy->options2 |= PR_O2_EXP_RSTR;
|
||||
free(curproxy->expect_str);
|
||||
if (curproxy->expect_regex) regfree(curproxy->expect_regex);
|
||||
if (curproxy->expect_regex) {
|
||||
regfree(curproxy->expect_regex);
|
||||
free(curproxy->expect_regex);
|
||||
curproxy->expect_regex = NULL;
|
||||
}
|
||||
curproxy->expect_str = strdup(args[cur_arg + 1]);
|
||||
curproxy->expect_regex = calloc(1, sizeof(regex_t));
|
||||
if (regcomp(curproxy->expect_regex, args[cur_arg + 1], REG_EXTENDED) != 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user