| 149 | |
| 150 | |
| 151 | void * uriEmulateReallocarray(UriMemoryManager * memory, |
| 152 | void * ptr, size_t nmemb, size_t size) { |
| 153 | const size_t total_size = nmemb * size; |
| 154 | |
| 155 | if (memory == NULL) { |
| 156 | errno = EINVAL; |
| 157 | return NULL; |
| 158 | } |
| 159 | |
| 160 | URI_CHECK_ALLOC_OVERFLOW(total_size, nmemb, size); /* may return */ |
| 161 | |
| 162 | return memory->realloc(memory, ptr, total_size); |
| 163 | } |
| 164 | |
| 165 | |
| 166 |
no outgoing calls