Fixed other instances of the xrealloc(0) bug.

This commit is contained in:
Alexandre Julliard 2005-03-18 14:09:55 +00:00
parent f65e415d64
commit b30d92dfb2
2 changed files with 3 additions and 3 deletions

View File

@ -36,7 +36,7 @@ void *xrealloc (void *op, size_t len)
{
void *p = realloc (op, len);
if (!p) report (R_FATAL, "Out of memory.");
if (len && !p) report (R_FATAL, "Out of memory.");
return p;
}

View File

@ -60,8 +60,8 @@ void* xmalloc(size_t size)
void *xrealloc(void* p, size_t size)
{
void* p2;
if ((p2 = realloc (p, size)) == NULL)
void* p2 = realloc (p, size);
if (size && !p2)
error("Can not realloc %d bytes.", size);
return p2;