Welcome! Log In Create A New Profile

Advanced

[nginx] Fixed potential leak of temp pool.

June 26, 2020 06:14AM
details: https://hg.nginx.org/nginx/rev/7e0719fb528b
branches:
changeset: 7671:7e0719fb528b
user: Eran Kornblau <erankor@gmail.com>
date: Mon Jun 15 03:58:31 2020 -0400
description:
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:

src/http/ngx_http.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diffs (20 lines):

diff -r ccb5ff87ab3e -r 7e0719fb528b src/http/ngx_http.c
--- a/src/http/ngx_http.c Mon Jun 22 18:03:00 2020 +0300
+++ b/src/http/ngx_http.c Mon Jun 15 03:58:31 2020 -0400
@@ -1469,14 +1469,14 @@ ngx_http_server_names(ngx_conf_t *cf, ng
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) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Fixed potential leak of temp pool.

ru@nginx.com 593 June 26, 2020 06:14AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 273
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready