]> git.kaiwu.me - nginx.git/commitdiff
fix max size allocated from pool
authorIgor Sysoev <igor@sysoev.ru>
Sat, 21 Jun 2008 06:40:32 +0000 (06:40 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sat, 21 Jun 2008 06:40:32 +0000 (06:40 +0000)
src/core/ngx_palloc.c

index 971887fd4c4a16feaaeca22898c514736a6fe872..5a0ea5121b9b3cb6be0f0cec4ce20f075ed67fd6 100644 (file)
@@ -26,8 +26,9 @@ ngx_create_pool(size_t size, ngx_log_t *log)
     p->d.end = (u_char *) p + size;
     p->d.next = NULL;
 
-    p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size - sizeof(ngx_pool_t):
-                                                NGX_MAX_ALLOC_FROM_POOL;
+    size = size - sizeof(ngx_pool_t);
+    p->max = (size < NGX_MAX_ALLOC_FROM_POOL) ? size : NGX_MAX_ALLOC_FROM_POOL;
+
     p->current = p;
     p->chain = NULL;
     p->large = NULL;