summaryrefslogtreecommitdiff
path: root/src/memory_bucket.cpp
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrikboy@gmail.com>2024-03-14 18:55:57 +0100
committerAldrik Ramaekers <aldrikboy@gmail.com>2024-03-14 18:55:57 +0100
commitf2b44f582dbb9d898e6aad1db6919b5a295815be (patch)
tree4c4b495c5c063a308c19e932c14aca45e7500954 /src/memory_bucket.cpp
parent33caee123ae6e79f251d1cd9d45ca62332e8d55b (diff)
static analysis fixes
Diffstat (limited to 'src/memory_bucket.cpp')
-rw-r--r--src/memory_bucket.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/memory_bucket.cpp b/src/memory_bucket.cpp
index b199e59..952d342 100644
--- a/src/memory_bucket.cpp
+++ b/src/memory_bucket.cpp
@@ -1,4 +1,5 @@
#include "memory_bucket.h"
+#include "config.h"
#include <stdlib.h>
ts_memory_bucket ts_memory_bucket_init(uint32_t bucket_size)
@@ -35,6 +36,7 @@ void* ts_memory_bucket_reserve(ts_memory_bucket *bucket, uint32_t reserve_length
// failed to find suitable space, allocate new bucket
ts_memory_bucket_entry new_bucket;
new_bucket.data = (char*)malloc(bucket_entry->length);
+ if (!new_bucket.data) exit_oom();
new_bucket.length = bucket_entry->length;
new_bucket.cursor = reserve_length;
ts_array_push(&bucket->buckets, &new_bucket);