# HG changeset patch # User Dan Preston # Date 1241504486 25200 # Node ID a9dd5ac5ff1184eb504bb8ebc4e6aa0e89dfae41 # Parent 1fadc382ece26f3b07ae72e3c2c7fdd55f4fbcc1 Cleaned up a few leaks found by clang checker. diff -r 1fadc382ece2 -r a9dd5ac5ff11 BLIP/BLIPProperties.m --- a/BLIP/BLIPProperties.m Mon May 04 23:10:51 2009 -0700 +++ b/BLIP/BLIPProperties.m Mon May 04 23:21:26 2009 -0700 @@ -351,7 +351,7 @@ Log(@"As data: %@", data); CAssertEqual(data,[NSMutableData dataWithLength: 2]); - BLIPMutableProperties *mprops = [props mutableCopy]; + BLIPMutableProperties *mprops = [[props mutableCopy] autorelease]; Log(@"Mutable copy:\n%@", mprops.allProperties); data = mprops.encodedData; Log(@"As data: %@", data); diff -r 1fadc382ece2 -r a9dd5ac5ff11 BLIP/BLIPTest.m --- a/BLIP/BLIPTest.m Mon May 04 23:10:51 2009 -0700 +++ b/BLIP/BLIPTest.m Mon May 04 23:21:26 2009 -0700 @@ -94,7 +94,7 @@ if (self != nil) { Log(@"** INIT %@",self); _pending = [[NSMutableDictionary alloc] init]; - IPAddress *addr = [[IPAddress alloc] initWithHostname: kListenerHost port: kListenerPort]; + IPAddress *addr = [[[IPAddress alloc] initWithHostname: kListenerHost port: kListenerPort] autorelease]; _conn = [[BLIPConnection alloc] initToAddress: addr]; if( ! _conn ) { [self release]; diff -r 1fadc382ece2 -r a9dd5ac5ff11 IPAddress.m --- a/IPAddress.m Mon May 04 23:10:51 2009 -0700 +++ b/IPAddress.m Mon May 04 23:21:26 2009 -0700 @@ -282,7 +282,7 @@ - (NSString*) description { - NSMutableString *desc = [_hostname mutableCopy]; + NSMutableString *desc = [[_hostname mutableCopy] autorelease]; NSString *addr = self.ipv4name; if (addr) [desc appendFormat: @"(%@)", addr]; @@ -385,6 +385,7 @@ CAssertEqual(addr.hostname,@"10.0.1.254"); CAssertEqual(addr.description,@"10.0.1.254:8080"); CAssert(addr.isPrivate); + [addr release]; addr = [[IPAddress alloc] initWithHostname: @"66.66.0.255" port: 123]; CAssertEq(addr.class,[IPAddress class]); @@ -393,7 +394,8 @@ CAssertEqual(addr.hostname,@"66.66.0.255"); CAssertEqual(addr.description,@"66.66.0.255:123"); CAssert(!addr.isPrivate); - + [addr release]; + addr = [[IPAddress alloc] initWithHostname: @"www.apple.com" port: 80]; CAssertEq(addr.class,[HostAddress class]); Log(@"www.apple.com = %@ [0x%08X]", addr.ipv4name, ntohl(addr.ipv4)); @@ -402,6 +404,7 @@ CAssertEqual(addr.hostname,@"www.apple.com"); CAssertEqual(addr.description,@"www.apple.com:80"); CAssert(!addr.isPrivate); + [addr release]; }