Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6470175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:04:45+00:00 2026-05-25T06:04:45+00:00

According to instrument there is memory leak at these lines cat.catName = (catName)?[NSString stringWithUTF8String:catName]:@;

  • 0

According to instrument there is memory leak at these lines

    cat.catName = (catName)?[NSString stringWithUTF8String:catName]:@"";
    NSData *dataForCachedImage = [[NSData alloc] initWithBytes:sqlite3_column_blob(statement, 2) length: sqlite3_column_bytes(statement, 2)];           
    cat.catThumb = [UIImage imageWithData:dataForCachedImage];
    [dataForCachedImage release];

in the following code.

I have also statically analyzed the code.. shows no issue in this file.

-(NSMutableArray *)getAllItems{
NSMutableArray *items = [[[NSMutableArray alloc] init] autorelease];

const char *sql = "SELECT * FROM category ORDER by sort";

sqlite3_stmt *statement;

int sqlresult = sqlite3_prepare(database, sql, -1, &statement, nil);

if (sqlresult == SQLITE_OK) {
    while (sqlite3_step(statement) == SQLITE_ROW) {
        Category *cat = [[Category alloc] init];

        char *catName = (char *)sqlite3_column_text(statement, 1);

        cat.catID = sqlite3_column_int(statement, 0);
        cat.catName = (catName)?[NSString stringWithUTF8String:catName]:@"";
        NSData *dataForCachedImage = [[NSData alloc] initWithBytes:sqlite3_column_blob(statement, 2) length: sqlite3_column_bytes(statement, 2)];           
        cat.catThumb = [UIImage imageWithData:dataForCachedImage];
        [dataForCachedImage release];
        cat.catLock = sqlite3_column_int(statement, 3);
        cat.sort = sqlite3_column_int(statement, 4);
        cat.total = [self totalSMS:cat.catID];

        [items addObject:cat];

        [cat release];
    }
    sqlite3_finalize(statement);
}

else
{
    NSLog(@"problem with the database");
    NSLog(@"%d",sqlresult);
}
return items;}

can someone point out?
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:04:45+00:00Added an answer on May 25, 2026 at 6:04 am

    ok.. resolved it!… the problem was that the catThumb was not released in Category class. thats it!, no other modification required… anyways, thx everybody!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to Instruments analysis, I have a memory leak here - and - I'm
According to the leak instrument in XCode it's saying this line is giving a
Maybe this a newbie question, but according to my instruments there is a leak
According to the documentation, they're pretty much interchangeable. Is there a stylistic reason to
I'm trying to clean my app from leaks with Leak instrument. It shows me
According to this answer ,it should print all function names: [root@ test]# cat hw.c
I've got a view controller that after leaving the stack, shows a memory leak
According to the answers in this comparison question , there's no technical difference between
According to stack-over flow guidance I did my memory management things. SO I discovered
I've been struggling to solve this memory leak for awhile now, so I'm hoping

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.