| 128 | } |
| 129 | |
| 130 | void *xrealloc(void *ptr, size_t size) |
| 131 | { |
| 132 | void *ret; |
| 133 | |
| 134 | if (!size) { |
| 135 | free(ptr); |
| 136 | return xmalloc(0); |
| 137 | } |
| 138 | |
| 139 | memory_limit_check(size, 0); |
| 140 | ret = realloc(ptr, size); |
| 141 | if (!ret) |
| 142 | die("Out of memory, realloc failed"); |
| 143 | return ret; |
| 144 | } |
| 145 | |
| 146 | void *xcalloc(size_t nmemb, size_t size) |
| 147 | { |
no test coverage detected