void ec_malloc_unregister(void)
{
+ /* XXX handlers must set errno on error */
ec_malloc_handler.malloc = NULL;
ec_malloc_handler.free = NULL;
ec_malloc_handler.realloc = NULL;
void *ptr;
size_t total;
+ /* check overflow */
total = size * nmemb;
if (nmemb != 0 && size != (total / nmemb)) {
errno = ENOMEM;