diff src/core/ngx_inet.c @ 3864:8e77b5216894

fix u->one_addr handling in ngx_inet_resolve_host() patch by Maxim Dounin
author Igor Sysoev <igor@sysoev.ru>
date Thu, 17 Feb 2011 15:01:16 +0000
parents 8de152fbb49d
children 4d4b5770616f
line wrap: on
line diff
--- a/src/core/ngx_inet.c
+++ b/src/core/ngx_inet.c
@@ -943,7 +943,7 @@ ngx_inet_resolve_host(ngx_pool_t *pool, 
 
         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) {