Opened 5 years ago
Closed 5 years ago
#1921 closed defect (duplicate)
Potential Memory Leak in directory 'src/http/modules'. file 'ngx_http_flv_module.c.patch'
Reported by: | 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_flv_module.c.patch' 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_flv_module.c.orig 2019-12-12 13:52:21.503948800 -0800
+++ ngx_http_flv_module.c 2019-12-12 13:53:32.479859700 -0800
@@ -224,6 +224,7 @@
b->file = ngx_pcalloc(r->pool, sizeof(ngx_file_t));
if (b->file == NULL) {
+ ngx_pfree(b); /* release previous memory allocation to b */
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
patch file for bug reported in ticket 1921