diff options
Diffstat (limited to 'linux_timer.c')
| -rw-r--r-- | linux_timer.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |
