]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: checks: queues null-deref
authormildis <me@mildis.org>
Tue, 2 Oct 2018 14:46:34 +0000 (16:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Oct 2018 13:17:47 +0000 (15:17 +0200)
queues can be null if calloc() failed.
Bypass free* calls when calloc did fail.

src/checks.c

index 52c762b55ad5baee74a1a47f0103461a1dfddd1f..5772c4f28d3645b97da75c2b013ebb4d3da2ea67 100644 (file)
@@ -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;
 }