Commit b30d92df authored by Alexandre Julliard's avatar Alexandre Julliard

Fixed other instances of the xrealloc(0) bug.

parent f65e415d
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment