--- tcc-0.9.12.orig/tcc.c 2002-09-22 14:28:24.000000000 +0800 +++ tcc-0.9.12/tcc.c 2002-09-22 14:26:43.000000000 +0800 @@ -765,7 +765,7 @@ { void *ptr; ptr = malloc(size); - if (!ptr) + if (!ptr && size) error("tcc malloc: memory full"); #ifdef MEM_DEBUG mem_cur_size += malloc_usable_size(ptr);