diff --git a/main.c b/main.c index b72e11c..b584942 100644 --- a/main.c +++ b/main.c @@ -825,7 +825,7 @@ void *qtb_calloc(size_t n, size_t size) { void *qtb_realloc(void *ptr, size_t size) { void *new_ptr = realloc(ptr, size); - if (!new_ptr) { + if (size != 0 && !new_ptr) { qtb_log("error: out of memory"); qtb_exit_with_status(ERROR_MEMORY); }