Fix memory allocation bug

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@13656 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2002-05-15 05:28:43 +00:00
parent 2aa83cb913
commit 1f5ed975ec
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
2002-05-14 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Unicode.m: GSFromUnicode(), GSToUnicode(), bugfix - ensure
that returned memory is allocated from specified zone, rather than
returning internal buffer.
2002-05-13 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileManager.m: Don't try to release memory using free()

View file

@ -925,7 +925,7 @@ tables:
}
ptr = r;
}
else if (zone != 0 && bsize > dpos)
else if (zone != 0 && (ptr == buf || bsize > dpos))
{
unsigned bytes = dpos * sizeof(unichar) + extra;
@ -1462,7 +1462,7 @@ tables:
}
ptr = r;
}
else if (zone != 0 && bsize > dpos)
else if (zone != 0 && (ptr == buf || bsize > dpos))
{
unsigned bytes = dpos + extra;