From d53c836214d7fe60963b069e49dd903f9e4078c1 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Thu, 17 Feb 2011 15:01:16 +0000 Subject: [PATCH] fix u->one_addr handling in ngx_inet_resolve_host() patch by Maxim Dounin --- src/core/ngx_inet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c index 91c7ef081..7440c280e 100644 --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -943,7 +943,7 @@ ngx_inet_resolve_host(ngx_pool_t *pool, ngx_url_t *u) u->naddrs = i; - for (i = 0; h->h_addr_list[i] != NULL; i++) { + for (i = 0; i < u->naddrs; i++) { sin = ngx_pcalloc(pool, sizeof(struct sockaddr_in)); if (sin == NULL) {