mirror of
https://github.com/nginx/nginx.git
synced 2025-06-29 10:40:39 +08:00
ngx_http_upstream_add() should return NULL if an error occurs.
This commit is contained in:
parent
01f07bde7e
commit
b163010872
@ -4422,12 +4422,12 @@ ngx_http_upstream_add(ngx_conf_t *cf, ngx_url_t *u, ngx_uint_t flags)
|
||||
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));
|
||||
|
Loading…
Reference in New Issue
Block a user