git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28450 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-08-11 13:36:39 +00:00
parent 10d2d0016c
commit 883af7762c

View file

@ -3256,10 +3256,14 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
#if GS_WITH_GC
owned = shouldFree; // Free memory on finalisation.
#else
if (shouldFree == NO)
if (shouldFree == NO || aBuffer == 0)
{
zone = 0; // Don't free this memory.
}
else
{
zone = NSZoneFromPointer(aBuffer);
}
#endif
bytes = aBuffer;
length = bufferSize;