[PATCH] Fixed potential leak of temp pool.
Ruslan Ermilov
ru at nginx.com
Fri Jun 26 16:38:22 UTC 2020
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 at 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 at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
--
Ruslan Ermilov
Assume stupidity not malice
More information about the nginx-devel
mailing list