aboutsummaryrefslogtreecommitdiff
path: root/teensy
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-05-15 07:24:14 -0400
committeriamcheeseman <[email protected]>2026-05-15 07:24:14 -0400
commit13176faf0daf862d3ceb88bec08120b2383a2592 (patch)
tree7354f8506e9a1a76e4ed735e30549620c1e087cc /teensy
parent89f8fe88ffd98f163860dddf7703b56272f076bb (diff)
check for alloc of size 0
Diffstat (limited to 'teensy')
-rw-r--r--teensy/teensy_mem.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/teensy/teensy_mem.c b/teensy/teensy_mem.c
index 40882a7..8c1022d 100644
--- a/teensy/teensy_mem.c
+++ b/teensy/teensy_mem.c
@@ -81,6 +81,8 @@ void ty_free_temp_allocs(void)
void *ty_alloc(size_t size)
{
+ if (size == 0)
+ ty_log_fatal(TY_ERR_MEM, "(%s) tried to allocate 0 bytes", __func__);
void *ptr = malloc(size);
if (!ptr)
ty_log_fatal(TY_ERR_MEM, "(%s) ran out of memory", __func__);