Don't crash on xrealloc(0) (found by Jon Griffiths).

This commit is contained in:
Alexandre Julliard 2005-03-18 14:03:38 +00:00
parent 7ff344e20f
commit b98d045e02
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ void *xmalloc (size_t size)
void *xrealloc (void *ptr, size_t size)
{
void *res = realloc (ptr, size);
if (res == NULL)
if (size && res == NULL)
{
fprintf (stderr, "Virtual memory exhausted.\n");
exit (1);