Cleaned up a few leaks found by clang checker.
authorDan Preston <danpreston@codechemistry.com>
Mon May 04 23:21:26 2009 -0700 (2009-05-04)
changeset 35a9dd5ac5ff11
parent 34 1fadc382ece2
child 36 5165944a89b3
Cleaned up a few leaks found by clang checker.
BLIP/BLIPProperties.m
BLIP/BLIPTest.m
IPAddress.m
     1.1 --- a/BLIP/BLIPProperties.m	Mon May 04 23:10:51 2009 -0700
     1.2 +++ b/BLIP/BLIPProperties.m	Mon May 04 23:21:26 2009 -0700
     1.3 @@ -351,7 +351,7 @@
     1.4      Log(@"As data: %@", data);
     1.5      CAssertEqual(data,[NSMutableData dataWithLength: 2]);
     1.6      
     1.7 -    BLIPMutableProperties *mprops = [props mutableCopy];
     1.8 +    BLIPMutableProperties *mprops = [[props mutableCopy] autorelease];
     1.9      Log(@"Mutable copy:\n%@", mprops.allProperties);
    1.10      data = mprops.encodedData;
    1.11      Log(@"As data: %@", data);
     2.1 --- a/BLIP/BLIPTest.m	Mon May 04 23:10:51 2009 -0700
     2.2 +++ b/BLIP/BLIPTest.m	Mon May 04 23:21:26 2009 -0700
     2.3 @@ -94,7 +94,7 @@
     2.4      if (self != nil) {
     2.5          Log(@"** INIT %@",self);
     2.6          _pending = [[NSMutableDictionary alloc] init];
     2.7 -        IPAddress *addr = [[IPAddress alloc] initWithHostname: kListenerHost port: kListenerPort];
     2.8 +        IPAddress *addr = [[[IPAddress alloc] initWithHostname: kListenerHost port: kListenerPort] autorelease];
     2.9          _conn = [[BLIPConnection alloc] initToAddress: addr];
    2.10          if( ! _conn ) {
    2.11              [self release];
     3.1 --- a/IPAddress.m	Mon May 04 23:10:51 2009 -0700
     3.2 +++ b/IPAddress.m	Mon May 04 23:21:26 2009 -0700
     3.3 @@ -282,7 +282,7 @@
     3.4  
     3.5  - (NSString*) description
     3.6  {
     3.7 -    NSMutableString *desc = [_hostname mutableCopy];
     3.8 +    NSMutableString *desc = [[_hostname mutableCopy] autorelease];
     3.9      NSString *addr = self.ipv4name;
    3.10      if (addr)
    3.11          [desc appendFormat: @"(%@)", addr];
    3.12 @@ -385,6 +385,7 @@
    3.13      CAssertEqual(addr.hostname,@"10.0.1.254");
    3.14      CAssertEqual(addr.description,@"10.0.1.254:8080");
    3.15      CAssert(addr.isPrivate);
    3.16 +	[addr release];
    3.17      
    3.18      addr = [[IPAddress alloc] initWithHostname: @"66.66.0.255" port: 123];
    3.19      CAssertEq(addr.class,[IPAddress class]);
    3.20 @@ -393,7 +394,8 @@
    3.21      CAssertEqual(addr.hostname,@"66.66.0.255");
    3.22      CAssertEqual(addr.description,@"66.66.0.255:123");
    3.23      CAssert(!addr.isPrivate);
    3.24 -    
    3.25 + 	[addr release];
    3.26 +   
    3.27      addr = [[IPAddress alloc] initWithHostname: @"www.apple.com" port: 80];
    3.28      CAssertEq(addr.class,[HostAddress class]);
    3.29      Log(@"www.apple.com = %@ [0x%08X]", addr.ipv4name, ntohl(addr.ipv4));
    3.30 @@ -402,6 +404,7 @@
    3.31      CAssertEqual(addr.hostname,@"www.apple.com");
    3.32      CAssertEqual(addr.description,@"www.apple.com:80");
    3.33      CAssert(!addr.isPrivate);
    3.34 +	[addr release];
    3.35  }
    3.36  
    3.37