if (total_size_max < bytes_remaining)
goto size_overflow;
total_size = bytes_remaining;
- data = malloc (total_size + 1);
- if (! data)
- goto memory_exhausted;
+ data = xmalloc (total_size + 1);
/* Now read, until we've gotten it all. */
while (bytes_remaining)
if (total_size - offset < bytes_gotten)
{
- unsigned char *data1;
ptrdiff_t remaining_lim = total_size_max - offset - bytes_gotten;
if (remaining_lim < 0 || remaining_lim < bytes_remaining)
goto size_overflow;
total_size = offset + bytes_gotten + bytes_remaining;
- data1 = realloc (data, total_size + 1);
- if (! data1)
- goto memory_exhausted;
- data = data1;
+ data = xrealloc (data, total_size + 1);
}
if (BITS_PER_LONG > 32 && *actual_format_ret == 32)
return;
size_overflow:
- free (data);
+ xfree (data);
unblock_input ();
memory_full (SIZE_MAX);
-
- memory_exhausted:
- free (data);
- unblock_input ();
- memory_full (total_size + 1);
}
\f
/* Use xfree, not XFree, to free the data obtained with this function. */