Opened 3 months ago

Closed 3 months ago

#1922 closed defect (duplicate)

Potential Memory Leak in directory 'src/http/modules'. file 'ngx_http_grpc_module.c'

Reported by: wp02855@… Owned by:
Priority: minor Milestone:
Component: nginx-module Version: 1.15.x
Keywords: potential memory leak(s) Cc:
uname -a: bill@foobar 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 GNU/Linux
nginx -V: nginx -V: version 1.15.0 (using static analysis of source code)

Description

In reviewing source code in nginx-1.15.0, it would appear that there are some memory leaks in file 'ngx_http_grpc_module.c' which when functions in this file are called, the memory allocations are not released, leading to over-utilization of memory over time, the patch file is below:

--- ngx_http_grpc_module.c.orig 2019-12-12 13:54:50.117489900 -0800
+++ ngx_http_grpc_module.c 2019-12-12 13:56:58.061122800 -0800
@@ -4568,11 +4568,13 @@

if (ngx_ssl_create(glcf->upstream.ssl, glcf->ssl_protocols, NULL)

!= NGX_OK)

{

+ ngx_pfree(glcf->upstream.ssl); /* release previous memory request */

return NGX_ERROR;

}


cln = ngx_pool_cleanup_add(cf->pool, 0);
if (cln == NULL) {

+ ngx_pfree(glcf->upstream.ssl); /* release previous memory request */

return NGX_ERROR;

}

Attachments (1)

ngx_http_grpc_module.c.patch (537 bytes ) - added by wp02855@… 3 months ago.
patch file for bug reported in ticket 1922

Download all attachments as: .zip

Change History (2)

by wp02855@…, 3 months ago

patch file for bug reported in ticket 1922

comment:1 by Maxim Dounin, 3 months ago

Resolution: duplicate
Status: newclosed

Duplicate of #1914.

Note: See TracTickets for help on using tickets.