mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Fix leak
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28450 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
10d2d0016c
commit
883af7762c
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue