Re: NSString leak or RedHerring again?
Re: NSString leak or RedHerring again?
- Subject: Re: NSString leak or RedHerring again?
- From: Keary Suska <email@hidden>
- Date: Thu, 5 Mar 2009 18:18:30 -0700
On Mar 5, 2009, at 12:26 PM, James Cicenia wrote:
OK That worked but now that I got you:
Why is it complaining about the indicated array below:
while (sqlite3_step(statement) == SQLITE_ROW) {
//find subtype as key in the dict first
if(![aDict objectForKey: [NSString stringWithUTF8String:(char
*)sqlite3_column_text(statement, 2)]]){
NSMutableArray *tmparray = [[NSMutableArray alloc]init];
<<<<<====== ===== Says it leaks?
[aDict setValue:tmparray forKey: [NSString stringWithUTF8String:
(char *)sqlite3_column_text(statement, 2)]];
[tmparray release];
}
May be a false positive, unless there is other code that may cause it
to leak. But, the following:
subtypeArray = [aDict objectForKey: [NSString stringWithUTF8String:
(char *)sqlite3_column_text(statement, 2)]];
[subtypeArray addObject: [NSString stringWithUTF8String:(char
*)sqlite3_column_text(statement, 0)]];
[aDict setValue:subtypeArray forKey: [NSString stringWithUTF8String:
(char *)sqlite3_column_text(statement, 2)]];
}
If subtypeArray is mutable, as it appears to be, the last statement is
useless and potentially dangerous.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden