diff --git a/AudioScrobbler/AudioScrobblerClient.m b/AudioScrobbler/AudioScrobblerClient.m index f945cb8a2..68b96ee53 100644 --- a/AudioScrobbler/AudioScrobblerClient.m +++ b/AudioScrobbler/AudioScrobblerClient.m @@ -137,11 +137,11 @@ addressForHost(NSString *hostname) } buffer[bytesRead] = '\0'; - result = [[NSString alloc] initWithUTF8String:buffer]; + result = [[[NSString alloc] autorelease] initWithUTF8String:buffer]; } while(keepGoing); - return [result autorelease]; + return result; } - (void) shutdown diff --git a/FileTree/PathWatcher.m b/FileTree/PathWatcher.m index 685712262..2282a12a4 100644 --- a/FileTree/PathWatcher.m +++ b/FileTree/PathWatcher.m @@ -67,6 +67,8 @@ static void myFSEventCallback( kFSEventStreamCreateFlagNone // Watch this and all its subdirectories ); + CFRelease(pathsToWatch); + FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); FSEventStreamStart(stream); diff --git a/Playlist/SecondsFormatter.m b/Playlist/SecondsFormatter.m index 20df246c2..511701444 100644 --- a/Playlist/SecondsFormatter.m +++ b/Playlist/SecondsFormatter.m @@ -71,7 +71,7 @@ NSScanner *scanner = nil; BOOL result = NO; int value = 0; - unsigned seconds; + unsigned seconds = 0; scanner = [NSScanner scannerWithString:string]; diff --git a/Plugins/APL/APLFile.m b/Plugins/APL/APLFile.m index 33c5a9d90..4aa3785e9 100644 --- a/Plugins/APL/APLFile.m +++ b/Plugins/APL/APLFile.m @@ -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; diff --git a/Plugins/CueSheet/CueSheet.m b/Plugins/CueSheet/CueSheet.m index 8b11ede3d..710fc7aed 100644 --- a/Plugins/CueSheet/CueSheet.m +++ b/Plugins/CueSheet/CueSheet.m @@ -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; } diff --git a/Plugins/M3u/M3uContainer.m b/Plugins/M3u/M3uContainer.m index 7f6e06774..cbf2b2f5c 100644 --- a/Plugins/M3u/M3uContainer.m +++ b/Plugins/M3u/M3uContainer.m @@ -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 diff --git a/Plugins/Pls/PlsContainer.m b/Plugins/Pls/PlsContainer.m index 8bb0c5d21..ffd57fc1d 100644 --- a/Plugins/Pls/PlsContainer.m +++ b/Plugins/Pls/PlsContainer.m @@ -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; }