aboutsummaryrefslogtreecommitdiff
path: root/src/std
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-09-18 13:33:05 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commitab0c5259e5a3238e176e4b1aed942f5384a2d0c6 (patch)
tree20111eefcafa13d92485ba6a0738c480f5c0c319 /src/std
parent7028a74894eba649beb9e1881dabaf94a29961a0 (diff)
Fix leak on parse failure
Diffstat (limited to 'src/std')
-rw-r--r--src/std/arena_allocator.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/std/arena_allocator.c b/src/std/arena_allocator.c
index 8b0083d..5e49035 100644
--- a/src/std/arena_allocator.c
+++ b/src/std/arena_allocator.c
@@ -102,8 +102,7 @@ int arena_allocator_alloc(ArenaAllocator *self, usize size, void **mem) {
}
int arena_allocator_add_mem(ArenaAllocator *self, usize *result_index) {
- void *null_data;
- null_data = NULL;
+ void *null_data = NULL;
*result_index = self->mems.size;
return buffer_append(&self->mems, &null_data, sizeof(void*));
}