]> git.kaiwu.me - nginx.git/commitdiff
fix u->one_addr handling in ngx_inet_resolve_host()
authorIgor Sysoev <igor@sysoev.ru>
Thu, 17 Feb 2011 15:01:16 +0000 (15:01 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 17 Feb 2011 15:01:16 +0000 (15:01 +0000)
patch by Maxim Dounin

src/core/ngx_inet.c

index 91c7ef0811df0b9a7a165a724127ae88af27ae93..7440c280ecbed50ec15dd0074f4cc849e2e74f91 100644 (file)
@@ -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) {