From b35551ddc948be413d179b798a0350eb2202bba8 Mon Sep 17 00:00:00 2001 From: Peter Fors Date: Fri, 5 Dec 2025 09:34:21 +0100 Subject: working --- linux_timer.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linux_timer.c') diff --git a/linux_timer.c b/linux_timer.c index 9a9d296..6a86fdd 100644 --- a/linux_timer.c +++ b/linux_timer.c @@ -101,6 +101,10 @@ static void *timer_thread_func(void *arg) { static struct timer_handle *timer_new(uint64_t interval_ns) { struct timer_handle *t = calloc(1, sizeof(struct timer_handle)); + if(!t) { + printf("ERROR: Could not allocate a timer!\n"); + exit(1); + } t->interval_ns = interval_ns; clock_gettime(CLOCK_MONOTONIC_RAW, &t->next_deadline); -- cgit v1.2.3