From b76b66188bff8c6315a0ba8e5a9f9d30679608aa Mon Sep 17 00:00:00 2001
From: mildis <me@mildis.org>
Date: Tue, 2 Oct 2018 16:46:34 +0200
Subject: [PATCH] BUG/MINOR: checks: queues null-deref

queues can be null if calloc() failed.
Bypass free* calls when calloc did fail.
---
 src/checks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/checks.c b/src/checks.c
index 52c762b5..5772c4f2 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -3235,7 +3235,7 @@ int init_email_alert(struct mailers *mls, struct proxy *p, char **err)
 
 	if ((queues = calloc(mls->count, sizeof(*queues))) == NULL) {
 		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) {
@@ -3292,6 +3292,7 @@ int init_email_alert(struct mailers *mls, struct proxy *p, char **err)
 		free_check(check);
 	}
 	free(queues);
+  fail_no_queue:
 	return 1;
 }
 
-- 
2.19.0

