Fix error in qtb_realloc
This commit is contained in:
parent
f952444d63
commit
4af0adf350
2
main.c
2
main.c
@ -825,7 +825,7 @@ void *qtb_calloc(size_t n, size_t size) {
|
|||||||
|
|
||||||
void *qtb_realloc(void *ptr, size_t size) {
|
void *qtb_realloc(void *ptr, size_t size) {
|
||||||
void *new_ptr = realloc(ptr, size);
|
void *new_ptr = realloc(ptr, size);
|
||||||
if (!new_ptr) {
|
if (size != 0 && !new_ptr) {
|
||||||
qtb_log("error: out of memory");
|
qtb_log("error: out of memory");
|
||||||
qtb_exit_with_status(ERROR_MEMORY);
|
qtb_exit_with_status(ERROR_MEMORY);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user