mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 22:31:28 +02:00
BUG/MINOR: checks: queues null-deref
queues can be null if calloc() failed. Bypass free* calls when calloc did fail.
This commit is contained in:
parent
cd2d7de44e
commit
5ab01cb011
@ -3235,7 +3235,7 @@ int init_email_alert(struct mailers *mls, struct proxy *p, char **err)
|
|||||||
|
|
||||||
if ((queues = calloc(mls->count, sizeof(*queues))) == NULL) {
|
if ((queues = calloc(mls->count, sizeof(*queues))) == NULL) {
|
||||||
memprintf(err, "out of memory while allocating mailer alerts queues");
|
memprintf(err, "out of memory while allocating mailer alerts queues");
|
||||||
goto error;
|
goto fail_no_queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (mailer = mls->mailer_list; mailer; i++, mailer = mailer->next) {
|
for (mailer = mls->mailer_list; mailer; i++, mailer = mailer->next) {
|
||||||
@ -3292,6 +3292,7 @@ int init_email_alert(struct mailers *mls, struct proxy *p, char **err)
|
|||||||
free_check(check);
|
free_check(check);
|
||||||
}
|
}
|
||||||
free(queues);
|
free(queues);
|
||||||
|
fail_no_queue:
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user