Browse files

Revert "Fixed leaks detected by static analyser."

This reverts commit f9d6e5f.
  • Loading branch information...
1 parent f9d6e5f commit 3bf5fb33c21e7550c3439c6c8d808140d63a9f75 @pablasso pablasso committed Jun 24, 2010
Showing with 10 additions and 11 deletions.
  1. +2 −2 OADataFetcher.m
  2. +8 −9 OAMutableURLRequest.m
View
4 OADataFetcher.m
@@ -55,7 +55,7 @@ - (void)connection:(NSURLConnection *)aConnection didFailWithError:(NSError *)er
response:response
data:responseData
didSucceed:NO];
- [ticket autorelease];
+
[delegate performSelector:didFailSelector withObject:ticket withObject:error];
}
@@ -68,7 +68,7 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
response:response
data:responseData
didSucceed:[(NSHTTPURLResponse *)response statusCode] < 400];
- [ticket autorelease];
+
[delegate performSelector:didFinishSelector withObject:ticket withObject:responseData];
}
View
17 OAMutableURLRequest.m
@@ -133,7 +133,7 @@ - (void)_generateTimestamp {
- (void)_generateNonce {
CFUUIDRef theUUID = CFUUIDCreate(NULL);
CFStringRef string = CFUUIDCreateString(NULL, theUUID);
- [NSMakeCollectable(theUUID) autorelease];
+ NSMakeCollectable(theUUID);
nonce = (NSString *)string;
}
@@ -144,11 +144,11 @@ - (NSString *)_signatureBaseString {
// 6 being the number of OAuth params in the Signature Base String
NSMutableArray *parameterPairs = [[NSMutableArray alloc] initWithCapacity:(5 + [[self parameters] count] + [tokenParameters count])];
- [parameterPairs addObject:[[[[OARequestParameter alloc] initWithName:@"oauth_consumer_key" value:consumer.key] autorelease] URLEncodedNameValuePair]];
- [parameterPairs addObject:[[[[OARequestParameter alloc] initWithName:@"oauth_signature_method" value:[signatureProvider name]] autorelease] URLEncodedNameValuePair]];
- [parameterPairs addObject:[[[[OARequestParameter alloc] initWithName:@"oauth_timestamp" value:timestamp] autorelease] URLEncodedNameValuePair]];
- [parameterPairs addObject:[[[[OARequestParameter alloc] initWithName:@"oauth_nonce" value:nonce] autorelease] URLEncodedNameValuePair]];
- [parameterPairs addObject:[[[[OARequestParameter alloc] initWithName:@"oauth_version" value:@"1.0"] autorelease] URLEncodedNameValuePair]];
+ [parameterPairs addObject:[[[OARequestParameter alloc] initWithName:@"oauth_consumer_key" value:consumer.key] URLEncodedNameValuePair]];
+ [parameterPairs addObject:[[[OARequestParameter alloc] initWithName:@"oauth_signature_method" value:[signatureProvider name]] URLEncodedNameValuePair]];
+ [parameterPairs addObject:[[[OARequestParameter alloc] initWithName:@"oauth_timestamp" value:timestamp] URLEncodedNameValuePair]];
+ [parameterPairs addObject:[[[OARequestParameter alloc] initWithName:@"oauth_nonce" value:nonce] URLEncodedNameValuePair]];
+ [parameterPairs addObject:[[[OARequestParameter alloc] initWithName:@"oauth_version" value:@"1.0"] URLEncodedNameValuePair]];
for(NSString *k in tokenParameters) {
@@ -161,9 +161,8 @@ - (NSString *)_signatureBaseString {
}
}
- [parameterPairs sortUsingSelector:@selector(compare:)];
- NSString *normalizedRequestParameters = [parameterPairs componentsJoinedByString:@"&"];
- [parameterPairs release];
+ NSArray *sortedPairs = [parameterPairs sortedArrayUsingSelector:@selector(compare:)];
+ NSString *normalizedRequestParameters = [sortedPairs componentsJoinedByString:@"&"];
// NSLog(@"Normalized: %@", normalizedRequestParameters);
// OAuth Spec, Section 9.1.2 "Concatenate Request Elements"

0 comments on commit 3bf5fb3

Please sign in to comment.