Fixed other instances of the xrealloc(0) bug.
This commit is contained in:
parent
f65e415d64
commit
b30d92dfb2
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue