Skip to content

Commit d94d27d

Browse files
committed
Fixing memory leaks found by static analyzer
1 parent dffe257 commit d94d27d

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

AFGowallaAPI.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ + (void)clearAuthorizationHeader {
8282

8383
+ (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters {
8484
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
85-
NSMutableDictionary *headers = [_defaultHeaders mutableCopy];
85+
NSMutableDictionary *headers = [NSMutableDictionary dictionaryWithDictionary:_defaultHeaders];
8686
NSURL *url = nil;
8787

8888
NSMutableArray *mutableParameterComponents = [NSMutableArray array];

AFHTTPOperation.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ - (void)finishWithError:(NSError *)error {
8989
[userInfo setValue:[[self.lastRequest URL] absoluteString] forKey:NSURLErrorFailingURLStringErrorKey];
9090
[userInfo setValue:data forKey:AFHTTPOperationParsedDataErrorKey];
9191

92-
error = [[NSError alloc] initWithDomain:NSURLErrorDomain code:[self.lastResponse statusCode] userInfo:userInfo];
92+
error = [[[NSError alloc] initWithDomain:NSURLErrorDomain code:[self.lastResponse statusCode] userInfo:userInfo] autorelease];
9393

9494
if (self.callback.errorBlock) {
9595
self.callback.errorBlock(self.lastRequest, self.lastResponse, error);

AFImageRequestOperation.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static inline CGSize kAFImageRequestRoundedCornerRadii(CGSize imageSize) {
3333
}
3434

3535
@implementation AFImageRequestOperation
36-
@synthesize callback;
36+
@synthesize callback = _callback;
3737

3838
- (id)initWithRequest:(NSURLRequest *)someRequest callback:(AFImageRequestOperationCallback *)someCallback {
3939
self = [super initWithRequest:someRequest];
@@ -74,8 +74,8 @@ - (void)finishWithError:(NSError *)error {
7474
[super finishWithError:error];
7575

7676
if (error) {
77-
if (callback.errorBlock) {
78-
callback.errorBlock(error);
77+
if (self.callback.errorBlock) {
78+
self.callback.errorBlock(error);
7979
}
8080

8181
return;

0 commit comments

Comments
 (0)