Fix error in qtb_realloc

This commit is contained in:
Alexander Rosenberg 2022-08-31 14:48:22 -07:00
parent f952444d63
commit 4af0adf350
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730

2
main.c
View File

@ -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);
}