mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-10 00:57:02 +02:00
BUG/MEDIUM: checks: Don't try to release undefined conn_stream when a check is freed
When a healt-check is released, the attached conn_stream may be undefined. For instance, this happens when 'no-check' option is used on a server line. So we must check it is defined before trying to release it. This patch must be backported in 1.8.
This commit is contained in:
parent
8d01fd6b3c
commit
23d86d157e
10
src/checks.c
10
src/checks.c
@ -3098,10 +3098,12 @@ void free_check(struct check *check)
|
|||||||
check->bi = NULL;
|
check->bi = NULL;
|
||||||
free(check->bo);
|
free(check->bo);
|
||||||
check->bo = NULL;
|
check->bo = NULL;
|
||||||
free(check->cs->conn);
|
if (check->cs) {
|
||||||
check->cs->conn = NULL;
|
free(check->cs->conn);
|
||||||
cs_free(check->cs);
|
check->cs->conn = NULL;
|
||||||
check->cs = NULL;
|
cs_free(check->cs);
|
||||||
|
check->cs = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void email_alert_free(struct email_alert *alert)
|
void email_alert_free(struct email_alert *alert)
|
||||||
|
Loading…
Reference in New Issue
Block a user