[njs] A possible memory leak has been fixed.

Igor Sysoev igor at sysoev.ru
Mon Oct 31 13:10:17 UTC 2016


details:   http://hg.nginx.org/njs/rev/f0ac27f59e58
branches:  
changeset: 230:f0ac27f59e58
user:      Igor Sysoev <igor at sysoev.ru>
date:      Mon Oct 31 15:51:12 2016 +0300
description:
A possible memory leak has been fixed.

Thanks to ??? (Hong Zhi Dao).

diffstat:

 nxt/nxt_mem_cache_pool.c |  3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r a1cd4104df67 -r f0ac27f59e58 nxt/nxt_mem_cache_pool.c
--- a/nxt/nxt_mem_cache_pool.c	Sat Oct 29 00:04:29 2016 +0300
+++ b/nxt/nxt_mem_cache_pool.c	Mon Oct 31 15:51:12 2016 +0300
@@ -574,14 +574,13 @@ nxt_mem_cache_alloc_large(nxt_mem_cache_
 
     } else {
         block = pool->proto->alloc(pool->mem, sizeof(nxt_mem_cache_block_t));
-
         if (nxt_slow_path(block == NULL)) {
-            pool->proto->free(pool->mem, block);
             return NULL;
         }
 
         p = pool->proto->align(pool->mem, alignment, size);
         if (nxt_slow_path(p == NULL)) {
+            pool->proto->free(pool->mem, block);
             return NULL;
         }
 



More information about the nginx-devel mailing list