From ab1e0af5ad7ae2028b595b74f7b66bff8b2f1559 Mon Sep 17 00:00:00 2001 From: Alex Vollmer Date: Mon, 5 Sep 2011 11:31:42 -0700 Subject: [PATCH] Fixed memory-leak warnings found by static analyzer --- OAMutableURLRequest.m | 2 +- OATokenManager.m | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/OAMutableURLRequest.m b/OAMutableURLRequest.m index 1375854..b738dcd 100644 --- a/OAMutableURLRequest.m +++ b/OAMutableURLRequest.m @@ -135,7 +135,7 @@ - (void)_generateTimestamp { - (void)_generateNonce { CFUUIDRef theUUID = CFUUIDCreate(NULL); CFStringRef string = CFUUIDCreateString(NULL, theUUID); - NSMakeCollectable(theUUID); + [NSMakeCollectable(theUUID) autorelease]; if (nonce) { CFRelease(nonce); } diff --git a/OATokenManager.m b/OATokenManager.m index eb18d3e..94f0cef 100644 --- a/OATokenManager.m +++ b/OATokenManager.m @@ -282,7 +282,7 @@ - (void)exchangeToken - (void)accessTokenReceived:(OACall *)call body:(NSString *)body { - OAToken *token = [[OAToken alloc] initWithHTTPResponseBody:body]; + OAToken *token = [[[OAToken alloc] initWithHTTPResponseBody:body] autorelease]; [self setAccessToken:token]; } @@ -361,10 +361,10 @@ - (void)dispatch { - (void)fetchData:(NSString *)aURL method:(NSString *)aMethod parameters:(NSArray *)theParameters files:(NSDictionary *)theFiles finished:(SEL)didFinish delegate:(NSObject*)aDelegate { - OACall *call = [[OACall alloc] initWithURL:[NSURL URLWithString:aURL] + OACall *call = [[[OACall alloc] initWithURL:[NSURL URLWithString:aURL] method:aMethod parameters:theParameters - files:theFiles]; + files:theFiles] autorelease]; NSLog(@"Received request for: %@", aURL); [self enqueue:call selector:didFinish]; if (aDelegate) {