From c3d8cd47e05c83cd5f515e52027110aaaa63ff0d Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sat, 1 Oct 2016 09:20:32 +0200 Subject: [PATCH] BUG/MEDIUM: dns: don't randomly crash on out-of-memory dns_init_resolvers() tries to emit the current resolver's name in the error message in case of out-of-memory condition. But it must not do it when initializing the trash before even having such a resolver otherwise the user is certain to get a dirty crash instead of the error message. No backport is needed. --- src/dns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dns.c b/src/dns.c index fc9354ed5..f21c50807 100644 --- a/src/dns.c +++ b/src/dns.c @@ -928,7 +928,7 @@ int dns_init_resolvers(void) dns_trash_str = malloc(global.tune.bufsize); if (dns_trash_str == NULL) { - Alert("Starting [%s] resolvers: out of memory.\n", curr_resolvers->id); + Alert("Starting resolvers: out of memory.\n"); return 0; }