• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSString leak or RedHerring again?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >NSString leak or RedHerring again? (From: James Cicenia <email@hidden>)
 >Re: NSString leak or RedHerring again? (From: Bill Bumgarner <email@hidden>)
 >Re: NSString leak or RedHerring again? (From: James Cicenia <email@hidden>)

  • Prev by Date: Re: launching per-user background agent 10.5 and higher
  • Next by Date: Re: launching per-user background agent 10.5 and higher
  • Previous by thread: Re: NSString leak or RedHerring again?
  • Next by thread: NSStatusItem when clicked shows custom view
  • Index(es):
    • Date
    • Thread