mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
[BUG] config: reset check request to avoid double free when switching to ssl/sql
SSL and SQL checks did only perform a free() of the request without replacing it, so having multiple SSL/SQL check declarations after another check type causes a double free condition during config parsing. This should be backported although it's harmless.
This commit is contained in:
parent
dc008c57a4
commit
54f6a586cd
1 changed files with 4 additions and 0 deletions
|
|
@ -2647,6 +2647,7 @@ stats_error_parsing:
|
|||
|
||||
/* use HTTP request to check servers' health */
|
||||
free(curproxy->check_req);
|
||||
curproxy->check_req = NULL;
|
||||
curproxy->options &= ~PR_O_SSL3_CHK;
|
||||
curproxy->options &= ~PR_O_SMTP_CHK;
|
||||
curproxy->options2 &= ~PR_O2_MYSQL_CHK;
|
||||
|
|
@ -2677,6 +2678,7 @@ stats_error_parsing:
|
|||
err_code |= ERR_WARN;
|
||||
|
||||
free(curproxy->check_req);
|
||||
curproxy->check_req = NULL;
|
||||
curproxy->options &= ~PR_O_HTTP_CHK;
|
||||
curproxy->options &= ~PR_O_SMTP_CHK;
|
||||
curproxy->options2 &= ~PR_O2_MYSQL_CHK;
|
||||
|
|
@ -2685,6 +2687,7 @@ stats_error_parsing:
|
|||
else if (!strcmp(args[1], "smtpchk")) {
|
||||
/* use SMTP request to check servers' health */
|
||||
free(curproxy->check_req);
|
||||
curproxy->check_req = NULL;
|
||||
curproxy->options &= ~PR_O_HTTP_CHK;
|
||||
curproxy->options &= ~PR_O_SSL3_CHK;
|
||||
curproxy->options2 &= ~PR_O2_MYSQL_CHK;
|
||||
|
|
@ -2710,6 +2713,7 @@ stats_error_parsing:
|
|||
else if (!strcmp(args[1], "mysql-check")) {
|
||||
/* use MYSQL request to check servers' health */
|
||||
free(curproxy->check_req);
|
||||
curproxy->check_req = NULL;
|
||||
curproxy->options &= ~PR_O_HTTP_CHK;
|
||||
curproxy->options &= ~PR_O_SSL3_CHK;
|
||||
curproxy->options &= ~PR_O_SMTP_CHK;
|
||||
|
|
|
|||
Loading…
Reference in a new issue