From 917a76bf33cf3ca936fedd1d68ea059b2be1b9dd Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 4 Jun 1999 11:50:05 +0000 Subject: [PATCH] Fix memory leak in init. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4354 72102866-910b-0410-8b05-ffd578937521 --- Source/NSArchiver.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/NSArchiver.m b/Source/NSArchiver.m index 54402fe35..bca2b15f8 100644 --- a/Source/NSArchiver.m +++ b/Source/NSArchiver.m @@ -62,8 +62,12 @@ static SEL eValSel = @selector(encodeValueOfObjCType:at:); - (id) init { - return [self initForWritingWithMutableData: - [[_fastCls._NSMutableDataMalloc allocWithZone: [self zone]] init]]; + NSMutableData *d; + + d = [[_fastCls._NSMutableDataMalloc allocWithZone: fastZone(self)] init]; + self = [self initForWritingWithMutableData: d]; + RELEASE(d); + return self; } - (id) initForWritingWithMutableData: (NSMutableData*)anObject