SF.net SVN: cogosx:[911] trunk/cog
Status: Beta
Brought to you by:
vspader
From: <vu...@us...> - 2008-08-26 17:45:19
|
Revision: 911 http://cogosx.svn.sourceforge.net/cogosx/?rev=911&view=rev Author: vurlix Date: 2008-08-26 17:45:16 +0000 (Tue, 26 Aug 2008) Log Message: ----------- fix some bugs reported by the clang static analyzer Modified Paths: -------------- trunk/cog/AudioScrobbler/AudioScrobblerClient.m trunk/cog/FileTree/PathWatcher.m trunk/cog/Playlist/SecondsFormatter.m trunk/cog/Plugins/APL/APLFile.m trunk/cog/Plugins/CueSheet/CueSheet.m trunk/cog/Plugins/M3u/M3uContainer.m trunk/cog/Plugins/Pls/PlsContainer.m Modified: trunk/cog/AudioScrobbler/AudioScrobblerClient.m =================================================================== --- trunk/cog/AudioScrobbler/AudioScrobblerClient.m 2008-06-25 01:38:03 UTC (rev 910) +++ trunk/cog/AudioScrobbler/AudioScrobblerClient.m 2008-08-26 17:45:16 UTC (rev 911) @@ -137,11 +137,11 @@ } buffer[bytesRead] = '\0'; - result = [[NSString alloc] initWithUTF8String:buffer]; + result = [[[NSString alloc] autorelease] initWithUTF8String:buffer]; } while(keepGoing); - return [result autorelease]; + return result; } - (void) shutdown Modified: trunk/cog/FileTree/PathWatcher.m =================================================================== --- trunk/cog/FileTree/PathWatcher.m 2008-06-25 01:38:03 UTC (rev 910) +++ trunk/cog/FileTree/PathWatcher.m 2008-08-26 17:45:16 UTC (rev 911) @@ -67,6 +67,8 @@ kFSEventStreamCreateFlagNone // Watch this and all its subdirectories ); + CFRelease(pathsToWatch); + FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); FSEventStreamStart(stream); Modified: trunk/cog/Playlist/SecondsFormatter.m =================================================================== --- trunk/cog/Playlist/SecondsFormatter.m 2008-06-25 01:38:03 UTC (rev 910) +++ trunk/cog/Playlist/SecondsFormatter.m 2008-08-26 17:45:16 UTC (rev 911) @@ -71,7 +71,7 @@ NSScanner *scanner = nil; BOOL result = NO; int value = 0; - unsigned seconds; + unsigned seconds = 0; scanner = [NSScanner scannerWithString:string]; Modified: trunk/cog/Plugins/APL/APLFile.m =================================================================== --- trunk/cog/Plugins/APL/APLFile.m 2008-06-25 01:38:03 UTC (rev 910) +++ trunk/cog/Plugins/APL/APLFile.m 2008-08-26 17:45:16 UTC (rev 911) @@ -37,7 +37,9 @@ NSString *basePath = [[[baseFilename stringByStandardizingPath] stringByDeletingLastPathComponent] stringByAppendingString:@"/"]; [unixPath insertString:basePath atIndex:0]; } - return [NSURL URLWithString:[[NSURL fileURLWithPath:unixPath] absoluteString]]; + NSURL *url = [NSURL URLWithString:[[NSURL fileURLWithPath:unixPath] absoluteString]]; + [unixPath release]; + return url; } -initWithFile:(NSString*)filename { @@ -56,7 +58,7 @@ NSLog(@"Cannot read header"); return nil; } - NSString* str = [[NSString alloc] initWithData:da encoding: NSASCIIStringEncoding]; + NSString* str = [[[NSString alloc] autorelease] initWithData:da encoding: NSASCIIStringEncoding]; if([str compare:header options:NSCaseInsensitiveSearch]) { NSLog(@"APL header mismatch"); return nil; Modified: trunk/cog/Plugins/CueSheet/CueSheet.m =================================================================== --- trunk/cog/Plugins/CueSheet/CueSheet.m 2008-06-25 01:38:03 UTC (rev 910) +++ trunk/cog/Plugins/CueSheet/CueSheet.m 2008-08-26 17:45:16 UTC (rev 911) @@ -54,7 +54,9 @@ } //Append the fragment - return [NSURL URLWithString:[[[NSURL fileURLWithPath:unixPath] absoluteString] stringByAppendingString: fragment]]; + NSURL *url = [NSURL URLWithString:[[[NSURL fileURLWithPath:unixPath] absoluteString] stringByAppendingString: fragment]]; + [unixPath release]; + return url; } Modified: trunk/cog/Plugins/M3u/M3uContainer.m =================================================================== --- trunk/cog/Plugins/M3u/M3uContainer.m 2008-06-25 01:38:03 UTC (rev 910) +++ trunk/cog/Plugins/M3u/M3uContainer.m 2008-08-26 17:45:16 UTC (rev 911) @@ -58,7 +58,9 @@ } //Append the fragment - return [NSURL URLWithString:[[[NSURL fileURLWithPath:unixPath] absoluteString] stringByAppendingString: fragment]]; + NSURL *url = [NSURL URLWithString:[[[NSURL fileURLWithPath:unixPath] absoluteString] stringByAppendingString: fragment]]; + [unixPath release]; + return url; } + (NSArray *)urlsForContainerURL:(NSURL *)url Modified: trunk/cog/Plugins/Pls/PlsContainer.m =================================================================== --- trunk/cog/Plugins/Pls/PlsContainer.m 2008-06-25 01:38:03 UTC (rev 910) +++ trunk/cog/Plugins/Pls/PlsContainer.m 2008-08-26 17:45:16 UTC (rev 911) @@ -58,7 +58,9 @@ } //Append the fragment - return [NSURL URLWithString:[[[NSURL fileURLWithPath:unixPath] absoluteString] stringByAppendingString: fragment]]; + NSURL *url = [NSURL URLWithString:[[[NSURL fileURLWithPath:unixPath] absoluteString] stringByAppendingString: fragment]]; + [unixPath release]; + return url; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |