fix u->one_addr handling in ngx_inet_resolve_host()

patch by Maxim Dounin
This commit is contained in:
Igor Sysoev 2011-02-17 15:01:16 +00:00
parent 95899a3f19
commit d53c836214

View File

@ -943,7 +943,7 @@ ngx_inet_resolve_host(ngx_pool_t *pool, ngx_url_t *u)
u->naddrs = i; 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)); sin = ngx_pcalloc(pool, sizeof(struct sockaddr_in));
if (sin == NULL) { if (sin == NULL) {