You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1005 B

  1. commit 8a6c4ff3f407b916bc08da4e76ed7813768ac937
  2. Author: mildis <me@mildis.org>
  3. Date: Tue Oct 2 16:46:34 2018 +0200
  4. BUG/MINOR: checks: queues null-deref
  5. queues can be null if calloc() failed.
  6. Bypass free* calls when calloc did fail.
  7. (cherry picked from commit 5ab01cb01114065a3573570a48e84815e751bf14)
  8. Signed-off-by: Willy Tarreau <w@1wt.eu>
  9. diff --git a/src/checks.c b/src/checks.c
  10. index 098ddecf..74958b2d 100644
  11. --- a/src/checks.c
  12. +++ b/src/checks.c
  13. @@ -3182,7 +3182,7 @@ int init_email_alert(struct mailers *mls, struct proxy *p, char **err)
  14. if ((queues = calloc(mls->count, sizeof(*queues))) == NULL) {
  15. memprintf(err, "out of memory while allocating mailer alerts queues");
  16. - goto error;
  17. + goto fail_no_queue;
  18. }
  19. for (mailer = mls->mailer_list; mailer; i++, mailer = mailer->next) {
  20. @@ -3239,6 +3239,7 @@ int init_email_alert(struct mailers *mls, struct proxy *p, char **err)
  21. free_check(check);
  22. }
  23. free(queues);
  24. + fail_no_queue:
  25. return 1;
  26. }