comparison src/http/ngx_http_upstream.c @ 4765:c48902a053d6

ngx_http_upstream_add() should return NULL if an error occurs.
author Ruslan Ermilov <ru@nginx.com>
date Sun, 29 Jul 2012 19:38:25 +0000
parents b38fea6f9a15
children 284cb8fb0741
comparison
equal deleted inserted replaced
4764:0ed8088f43b4 4765:c48902a053d6
4420 4420
4421 if (u->naddrs == 1) { 4421 if (u->naddrs == 1) {
4422 uscf->servers = ngx_array_create(cf->pool, 1, 4422 uscf->servers = ngx_array_create(cf->pool, 1,
4423 sizeof(ngx_http_upstream_server_t)); 4423 sizeof(ngx_http_upstream_server_t));
4424 if (uscf->servers == NULL) { 4424 if (uscf->servers == NULL) {
4425 return NGX_CONF_ERROR; 4425 return NULL;
4426 } 4426 }
4427 4427
4428 us = ngx_array_push(uscf->servers); 4428 us = ngx_array_push(uscf->servers);
4429 if (us == NULL) { 4429 if (us == NULL) {
4430 return NGX_CONF_ERROR; 4430 return NULL;
4431 } 4431 }
4432 4432
4433 ngx_memzero(us, sizeof(ngx_http_upstream_server_t)); 4433 ngx_memzero(us, sizeof(ngx_http_upstream_server_t));
4434 4434
4435 us->addrs = u->addrs; 4435 us->addrs = u->addrs;