diff --git a/src/extThree20JSON/Source/TTURLJSONResponse.m b/src/extThree20JSON/Source/TTURLJSONResponse.m index 4a138c2d1c..c74af06462 100644 --- a/src/extThree20JSON/Source/TTURLJSONResponse.m +++ b/src/extThree20JSON/Source/TTURLJSONResponse.m @@ -62,12 +62,11 @@ - (NSError*)request:(TTURLRequest*)request processResponse:(NSHTTPURLResponse*)r NSError* err = nil; if ([data isKindOfClass:[NSData class]]) { #ifdef EXTJSON_SBJSON - NSString* json = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSString* json = [[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding] autorelease]; // When there are newline characters in the JSON string, // the error "Unescaped control character '0x9'" will be thrown. This removes those characters. json = [json stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]]; _rootObject = [[json JSONValue] retain]; - TT_RELEASE_SAFELY(json); if (!_rootObject) { err = [NSError errorWithDomain:kTTExtJSONErrorDomain code:kTTExtJSONErrorCodeInvalidJSON