From 02c849bdc8439b652f135c4ddbe98a5d4d4f3749 Mon Sep 17 00:00:00 2001 From: Tom Wanielista Date: Fri, 27 Apr 2012 11:45:47 -0700 Subject: [PATCH] Fix an issue where the skipped character set points to bad memory. --- AFNetworking/AFHTTPRequestOperation.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AFNetworking/AFHTTPRequestOperation.m b/AFNetworking/AFHTTPRequestOperation.m index 5641aff..67b34bf 100644 --- a/AFNetworking/AFHTTPRequestOperation.m +++ b/AFNetworking/AFHTTPRequestOperation.m @@ -29,7 +29,7 @@ NSSet * AFContentTypesFromHTTPHeader(NSString *string) { static NSCharacterSet *_skippedCharacterSet = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - _skippedCharacterSet = [NSCharacterSet characterSetWithCharactersInString:@" ,"]; + _skippedCharacterSet = [[NSCharacterSet characterSetWithCharactersInString:@" ,"] retain]; }); if (!string) {