From b912759050b72855f2347d3fc7383133badd3d16 Mon Sep 17 00:00:00 2001 From: Ivar Fatland Date: Sat, 6 Dec 2025 14:19:33 +0100 Subject: [PATCH] only allocate non-zero capacities --- arena_allocator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arena_allocator.c b/arena_allocator.c index 1c63cbe..6a12df1 100644 --- a/arena_allocator.c +++ b/arena_allocator.c @@ -9,7 +9,7 @@ static void arena_reset(arena_allocator_t *this) { allocator_reset(this->allocator); this->data = NULL; } - if (this->data == NULL) { + if (this->data == NULL && this->capacity != 0) { this->data = allocator_alloc(this->allocator, this->capacity); } this->size = 0;