Changeset 528


Ignore:
Timestamp:
Aug 5, 2003, 12:16:22 PM (22 years ago)
Author:
bird
Message:

Someone (EM) should read the malloc and realloc docs. malloc(0) may return NULL quite legally. realloc(pv, 0) is legal and means free(pv), which of course returns 0.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/emx/src/emxomf/emxomf.c

    • Property cvs2svn:cvs-rev changed from 1.19 to 1.20
    r527 r528  
    506506
    507507  p = malloc (n);
    508   if (p == NULL)
     508  if (p == NULL && n)
    509509    error ("Out of memory");
    510510  return p;
     
    521521
    522522  p = realloc (ptr, n);
    523   if (p == NULL)
     523  if (p == NULL && n)
    524524    error ("Out of memory");
    525525  return p;
Note: See TracChangeset for help on using the changeset viewer.