fix the previous commit

This commit is contained in:
Igor Sysoev 2008-06-20 21:06:53 +00:00
parent 5a4c61658b
commit 11864a706a

View File

@ -159,14 +159,19 @@ ngx_palloc_block(ngx_pool_t *pool, size_t size)
psize = (size_t) (pool->d.end - (u_char *) pool);
new = ngx_alloc(size, pool->log);
if (new == NULL) {
m = ngx_alloc(psize, pool->log);
if (m == NULL) {
return NULL;
}
new->d.end = (u_char *) new + psize;
new = (ngx_pool_t *) m;
new->d.end = m + psize;
new->d.next = NULL;
m += sizeof(ngx_pool_data_t);
new->d.last = m + size;
current = pool->current;
for (p = current; p->d.next; p = p->d.next) {
@ -179,9 +184,6 @@ ngx_palloc_block(ngx_pool_t *pool, size_t size)
pool->current = current ? current : new;
m = (u_char *) new + sizeof(ngx_pool_data_t);
new->d.last = m + size;
return m;
}