﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
1919	Potential Memory Leak in directory 'src/core'. file 'ngx_hash.c.patch'	wp02855@…		"In reviewing source code in nginx-1.15.0, it would appear that there are some memory leaks in file 'ngx_hash.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_hash.c.orig     2019-12-12 11:57:11.686837700 -0800
+++ ngx_hash.c  2019-12-12 12:02:06.045371000 -0800
@@ -696,12 +696,15 @@
     ha->dns_wc_head_hash = ngx_pcalloc(ha->temp_pool,
                                        sizeof(ngx_array_t) * ha->hsize);
     if (ha->dns_wc_head_hash == NULL) {
+       ngx_pfree(ha->keys_hash);   /* release previous memory allocation */
         return NGX_ERROR;
     }
 
     ha->dns_wc_tail_hash = ngx_pcalloc(ha->temp_pool,
                                        sizeof(ngx_array_t) * ha->hsize);
     if (ha->dns_wc_tail_hash == NULL) {
+       ngx_pfree(ha->dns_wc_tail_hash);    /* release tail_hash    */
+       ngx_pfree(ha->keys_hash);           /* release keys_hash    */
         return NGX_ERROR;
     }"	defect	closed	minor		nginx-core	1.15.x	duplicate	potential memory leak(s)		bill@foobar 4.4.0-18362-Microsoft #476-Microsoft Fri Nov 01 16:53:00 PST 2019 x86_64 GNU/Linux 	nginx -V: version 1.15.0 (using static analysis of source code) 
