memory leak fix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17805 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2003-10-09 09:12:23 +00:00
parent c4b038113d
commit f68efed229
2 changed files with 6 additions and 13 deletions

View file

@ -1,3 +1,8 @@
2003-10-09 Richard Frith-Macdonald <rfm@gnu.org>
* GSArray.m: memory leak decoding a placeholder fixed.
Patch by <Roland.Schwingel@onevision.de>
2003-10-08 Richard Frith-Macdonald <rfm@gnu.org> 2003-10-08 Richard Frith-Macdonald <rfm@gnu.org>
* Tools/gdomap.c: Added some checks that getting/setting uid/gid * Tools/gdomap.c: Added some checks that getting/setting uid/gid

View file

@ -969,25 +969,13 @@ static Class GSInlineArrayClass;
unsigned c; unsigned c;
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &c]; [aCoder decodeValueOfObjCType: @encode(unsigned) at: &c];
a = (id)NSAllocateObject(GSInlineArrayClass, sizeof(id)*c, a = (id)NSAllocateObject(GSInlineArrayClass, sizeof(id)*c, GSObjCZone(self));
GSObjCZone(self));
a->_contents_array = (id*)&a[1]; a->_contents_array = (id*)&a[1];
if (c > 0) if (c > 0)
{ {
#if !GS_WITH_GC
unsigned i;
#endif
[aCoder decodeArrayOfObjCType: @encode(id) [aCoder decodeArrayOfObjCType: @encode(id)
count: c count: c
at: a->_contents_array]; at: a->_contents_array];
#if !GS_WITH_GC
for (i = 0; i < c; i++)
{
a->_contents_array[i] = RETAIN(a->_contents_array[i]);
a->_count = i;
}
#endif
} }
a->_count = c; a->_count = c;
return a; return a;