summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nxt_buf_pool.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nxt_buf_pool.c b/src/nxt_buf_pool.c
index 8259c60a..f2be88a7 100644
--- a/src/nxt_buf_pool.c
+++ b/src/nxt_buf_pool.c
@@ -172,11 +172,12 @@ nxt_buf_pool_free(nxt_buf_pool_t *bp, nxt_buf_t *b)
void
nxt_buf_pool_destroy(nxt_buf_pool_t *bp)
{
- nxt_buf_t *b;
+ nxt_buf_t *b, *n;
bp->destroy = 1;
- for (b = bp->free; b != NULL; b = b->next) {
+ for (b = bp->free; b != NULL; b = n) {
+ n = b->next;
nxt_buf_free(bp->mem_pool, b);
}