From 13176faf0daf862d3ceb88bec08120b2383a2592 Mon Sep 17 00:00:00 2001 From: iamcheeseman Date: Fri, 15 May 2026 07:24:14 -0400 Subject: check for alloc of size 0 --- teensy/teensy_mem.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'teensy') 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__); -- cgit v1.3-2-g0d8e