fix some bugs reported by the clang static analyzer
parent
5132465651
commit
38e6e9af62
|
@ -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
|
||||
|
|
|
@ -67,6 +67,8 @@ static void myFSEventCallback(
|
|||
kFSEventStreamCreateFlagNone // Watch this and all its subdirectories
|
||||
);
|
||||
|
||||
CFRelease(pathsToWatch);
|
||||
|
||||
FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
|
||||
|
||||
FSEventStreamStart(stream);
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
NSScanner *scanner = nil;
|
||||
BOOL result = NO;
|
||||
int value = 0;
|
||||
unsigned seconds;
|
||||
unsigned seconds = 0;
|
||||
|
||||
scanner = [NSScanner scannerWithString:string];
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue