check to see if we should free memory

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38529 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-05-23 21:35:03 +00:00
parent 19ba70e988
commit 696c4dd7a3
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2015-05-23 Richard Frith-Macdonald <rfm@gnu.org>
Source/GSString.m: Fix failure to check free when done flag before
freeing memory.
2015-05-22 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSString.m:

View file

@ -1358,7 +1358,7 @@ fixBOM(unsigned char **bytes, NSUInteger*length, BOOL *owned,
if (0 == length)
{
if (0 != bytes)
if (YES == flag && 0 != bytes)
{
NSZoneFree(NSZoneFromPointer(bytes), bytes);
}