Author: paullanders
Date: Wed Aug 12 19:10:18 2015
New Revision: 38873
URL: http://svn.gna.org/viewcvs/gnustep?rev=38873&view=rev
Log:
New runtime is returning null pointers when malloc(0), which is allowed, and
does not indicate out of memory.
So we let the null be returned instead of raising an exception when the size
was zero.
Modified:
libs/base/branches/gnustep_testplant_branch/Source/NSZone.m
Modified: libs/base/branches/gnustep_testplant_branch/Source/NSZone.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/branches/gnustep_testplant_branch/Source/NSZone.m?rev=38873&r1=38872&r2=38873&view=diff
==============================================================================
--- libs/base/branches/gnustep_testplant_branch/Source/NSZone.m (original)
+++ libs/base/branches/gnustep_testplant_branch/Source/NSZone.m Wed Aug 12
19:10:18 2015
@@ -120,7 +120,7 @@
void *mem;
mem = malloc(size);
- if (mem != NULL)
+ if (mem != NULL || size == 0)
{
return mem;
}
@@ -135,7 +135,7 @@
void *mem;
mem = realloc(ptr, size);
- if (mem != NULL)
+ if (mem != NULL || size == 0)
{
return mem;
}
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs