aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_alloc.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-08-06 14:43:50 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-08-06 14:43:50 +0000
commit31ef351c235dfaa1831b5218eb0c1054a95d4f5d (patch)
treeb4a0fbbfe4a4e507b6afae931224e192215af780 /src/core/ngx_alloc.c
parent7f4003a76ad894ddc074c5b0dbbf89c699badef4 (diff)
downloadnginx-31ef351c235dfaa1831b5218eb0c1054a95d4f5d.tar.gz
nginx-31ef351c235dfaa1831b5218eb0c1054a95d4f5d.zip
nginx-0.0.1-2003-08-06-18:43:50 import
Diffstat (limited to 'src/core/ngx_alloc.c')
-rw-r--r--src/core/ngx_alloc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core/ngx_alloc.c b/src/core/ngx_alloc.c
index 050fcbfa8..110ab0161 100644
--- a/src/core/ngx_alloc.c
+++ b/src/core/ngx_alloc.c
@@ -59,16 +59,20 @@ void ngx_destroy_pool(ngx_pool_t *pool)
free(l->alloc);
}
- for (p = pool, n = pool->next; /* void */; p = n, n = n->next) {
+ /* we can use pool->log so we have to free() pool after all */
+
+ for (p = pool->next; p ; p = n) {
#if (NGX_DEBUG_ALLOC)
ngx_log_debug(pool->log, "free: %08x" _ p);
#endif
+ n = p->next;
free(p);
-
- if (n == NULL) {
- break;
- }
}
+
+#if (NGX_DEBUG_ALLOC)
+ ngx_log_debug(pool->log, "free: %08x" _ pool);
+#endif
+ free(pool);
pool = NULL;
}