robbiehanson/CocoaLumberjack — Issue #21: Multiple memory leaks in DDLogMessage
Author: suhaildutta
Created: 2012-02-13 05:00:03+00:00
State: open

When running the profile over my application for iOS
- XCode 4.2.1
- No ARC
- Using a custom log formatter (from the example in the docs)

I found a set of memory leaks in the DDLogMessage class

[DDLogMessage methodName]
[DDLogMessage threadID]
[DDLogMessage fileName]

Each of these methods alloc's a new string, assigns it to a member but then doesn't decrement the retain count at the end of the method

e.g.
- (NSString *)methodName
{
if (methodName == nil && function != NULL)
{
methodName = [[NSString alloc] initWithUTF8String:function];
}

return methodName;
}

the line with the alloc should have an autorelease at the end of it right?