fix ngx_reset_pool

梁思健 liangsijian at foxmail.com
Mon Jul 18 16:38:58 UTC 2016


# HG changeset patch
# User Liang Sijian <liangsijian at foxmail.com>
# Date 1468859189 -28800
#      Tue Jul 19 00:26:29 2016 +0800
# Node ID 45ef1e0a48a82b2a81db6bc447aaeb16a10056f9
# Parent  6acaa638fa074dada02ad4544a299584da9abc85
fix ngx_reset_pool

diff --git a/src/core/ngx_palloc.c b/src/core/ngx_palloc.c
--- a/src/core/ngx_palloc.c
+++ b/src/core/ngx_palloc.c
@@ -109,7 +109,8 @@ ngx_reset_pool(ngx_pool_t *pool)
     }
 
     for (p = pool; p; p = p->d.next) {
-        p->d.last = (u_char *) p + sizeof(ngx_pool_t);
+        p->d.last = (u_char *) p +
+            (p == pool ? sizeof(ngx_pool_t ) : sizeof(ngx_pool_data_t));
         p->d.failed = 0;
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20160719/e430919c/attachment.html>


More information about the nginx mailing list