# HG changeset patch # User Maxim Dounin # Date 1344273601 0 # Node ID 6fc86fe0b58608c0972612466b27902dfaf7d9ea # Parent 8f2f71233f5b8f82ff9b103494293411e72d6ac6 Merge of r4766, r4767: ngx_http_upstream_add() changes. *) Fixed to return NULL if an error occurs. *) Microoptimization: replaced an expression known to be constant with the constant value. diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -4422,18 +4422,18 @@ ngx_http_upstream_add(ngx_conf_t *cf, ng uscf->servers = ngx_array_create(cf->pool, 1, sizeof(ngx_http_upstream_server_t)); if (uscf->servers == NULL) { - return NGX_CONF_ERROR; + return NULL; } us = ngx_array_push(uscf->servers); if (us == NULL) { - return NGX_CONF_ERROR; + return NULL; } ngx_memzero(us, sizeof(ngx_http_upstream_server_t)); us->addrs = u->addrs; - us->naddrs = u->naddrs; + us->naddrs = 1; } uscfp = ngx_array_push(&umcf->upstreams);