From 4af0adf350cc107faf0a587287d64d6f60d219ec Mon Sep 17 00:00:00 2001 From: Alexander Rosenberg Date: Wed, 31 Aug 2022 14:48:22 -0700 Subject: [PATCH] Fix error in qtb_realloc --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }