Fix an issue where the skipped character set points to bad memory.

This commit is contained in:
Tom Wanielista 2012-04-27 11:45:47 -07:00
parent c77a001e73
commit 02c849bdc8

View file

@ -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) {