... let's stay compatible
Showing the changes to libtcc.c (1 of 4 files). Show all
Unified · Split
| @@ -242,7 +242,7 @@ static void *(*reallocator)(void*, unsigned long) = default_reallocator; · 241 unmodified lines | ||
| 242 | 242 | |
| 243 | 243 | LIBTCCAPI void tcc_set_realloc(TCCReallocFunc *realloc) |
| 244 | 244 | { |
| 245 | − reallocator = realloc; | |
| 245 | + reallocator = realloc ? realloc : default_reallocator; | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | /* in case MEM_DEBUG is #defined */ |