Fixed some memory leaks reported by the clang static analyzer, by autoreleasing these objects immediately rather than releasing some of them later (and not all of the time).
authorboredzo
Sun Jul 06 17:31:40 2008 +0000 (2008-07-06)
changeset 4141494e5044075d
parent 4140 ab8742429e22
child 4142 5deddffb750a
Fixed some memory leaks reported by the clang static analyzer, by autoreleasing these objects immediately rather than releasing some of them later (and not all of the time).
Plugins/Displays/SMS/GrowlSMSDisplay.m
     1.1 --- a/Plugins/Displays/SMS/GrowlSMSDisplay.m	Sun Jul 06 17:12:11 2008 +0000
     1.2 +++ b/Plugins/Displays/SMS/GrowlSMSDisplay.m	Sun Jul 06 17:31:40 2008 +0000
     1.3 @@ -53,8 +53,11 @@
     1.4  	NSString	*destinationNumberValue = nil;
     1.5  
     1.6  	READ_GROWL_PREF_VALUE(destinationNumberKey, GrowlSMSPrefDomain, NSString *, &destinationNumberValue);
     1.7 +	[destinationNumberValue autorelease];
     1.8  	READ_GROWL_PREF_VALUE(accountAPIIDKey, GrowlSMSPrefDomain, NSString *, &apiIDValue);
     1.9 +	[apiIDValue autorelease];
    1.10  	READ_GROWL_PREF_VALUE(accountNameKey, GrowlSMSPrefDomain, NSString *, &accountNameValue);
    1.11 +	[accountNameValue autorelease];
    1.12  
    1.13  	if (!([destinationNumberValue length] && [apiIDValue length] && [accountNameValue length])) {
    1.14  		NSLog(@"Cannot send SMS - not enough details in preferences.");
    1.15 @@ -112,10 +115,6 @@
    1.16  	[self sendXMLCommand:checkBalanceCommand];
    1.17  	[checkBalanceCommand release];
    1.18  
    1.19 -	[destinationNumberValue release];
    1.20 -	[accountAPIIDKey release];
    1.21 -	[accountNameKey release];
    1.22 -
    1.23  	id clickContext = [noteDict objectForKey:GROWL_NOTIFICATION_CLICK_CONTEXT];
    1.24  	if (clickContext) {
    1.25  		NSDictionary *userInfo = [[NSDictionary alloc] initWithObjectsAndKeys: