mirror of
https://github.com/nginx/nginx.git
synced 2024-12-01 03:17:17 +08:00
fix the previous commit
This commit is contained in:
parent
5a4c61658b
commit
11864a706a
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user