diff --git a/src/util.c b/src/util.c index f00d33a..2911438 100644 --- a/src/util.c +++ b/src/util.c @@ -28,6 +28,10 @@ void dp_log_fatal(const char *fmt, ...) { } void *dp_zalloc(size_t size) { + if (size == 0) { + return NULL; + } + void *ptr = calloc(1, size); if (ptr == NULL) { dp_log_fatal("Failed to allocate %zu bytes", size);