Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Fixed potential leak of temp pool.

June 26, 2020 12:40PM
On Mon, Jun 15, 2020 at 08:48:41AM +0000, Eran Kornblau wrote:
> Hi
>
> Something I noticed today while looking at the code, it probably won't matter to anyone ever...
> But just sending for the sake of perfection :)
>
> Thanks!
>
> Eran

Committed, thanks!

https://hg.nginx.org/nginx/rev/7e0719fb528b

> # HG changeset patch
> # User erankor <erankor@gmail.com>
> # Date 1592207911 14400
> # Mon Jun 15 03:58:31 2020 -0400
> # Node ID 7037b11208c1be350c399bf0917b439fb5356d3b
> # Parent cb27bda9557fede50b531a0b3b4db98b38cc937a
> 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.
>
> diff -r cb27bda9557f -r 7037b11208c1 src/http/ngx_http.c
> --- a/src/http/ngx_http.c Mon Aug 07 06:10:34 2017 -0400
> +++ b/src/http/ngx_http.c Mon Jun 15 03:58:31 2020 -0400
> @@ -1466,14 +1466,14 @@
> 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 %s",
> &name[n].name, addr->opt.addr);
> - 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


--
Ruslan Ermilov
Assume stupidity not malice
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Fixed potential leak of temp pool. Attachments

erankor 105 June 15, 2020 04:50AM

Re: [PATCH] Fixed potential leak of temp pool.

ru@nginx.com 24 June 26, 2020 12:40PM



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

Online Users

Guests: 61
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready