A modified version of realloc(). * If UTIL_realloc() fails the original block is freed. */
| 70 | * If UTIL_realloc() fails the original block is freed. |
| 71 | */ |
| 72 | UTIL_STATIC void* UTIL_realloc(void *ptr, size_t size) |
| 73 | { |
| 74 | void *newptr = realloc(ptr, size); |
| 75 | if (newptr) return newptr; |
| 76 | free(ptr); |
| 77 | return NULL; |
| 78 | } |
| 79 | |
| 80 | #if defined(_MSC_VER) |
| 81 | #define chmod _chmod |
no test coverage detected