aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEran Kornblau <erankor@gmail.com>2020-06-15 03:58:31 -0400
committerEran Kornblau <erankor@gmail.com>2020-06-15 03:58:31 -0400
commit1bbc37d35c67c0ef5271551f8e40fd899442d157 (patch)
treeb079417c43cf13e044b1d0a69bf5293f9ca2fe96 /src
parent0a683fdd9313b9796bf39442fd117beaa63a7157 (diff)
downloadnginx-1bbc37d35c67c0ef5271551f8e40fd899442d157.tar.gz
nginx-1bbc37d35c67c0ef5271551f8e40fd899442d157.zip
Fixed potential leak of temp pool.
In case ngx_hash_add_key() fails, need to goto failed instead of returning, so that temp_pool will be destoryed.
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
index 79ef9c644..a35e9bb8a 100644
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -1469,14 +1469,14 @@ ngx_http_server_names(ngx_conf_t *cf, ngx_http_core_main_conf_t *cmcf,
NGX_HASH_WILDCARD_KEY);
if (rc == NGX_ERROR) {
- return NGX_ERROR;
+ goto failed;
}
if (rc == NGX_DECLINED) {
ngx_log_error(NGX_LOG_EMERG, cf->log, 0,
"invalid server name or wildcard \"%V\" on %V",
&name[n].name, &addr->opt.addr_text);
- return NGX_ERROR;
+ goto failed;
}
if (rc == NGX_BUSY) {