Closed andrewtremblay closed 11 years ago
this pull should close issues #14, #17, #19, and #20
The old customParams functionality snuck in as well. You'll have to okay those as well, @spitz .
Its not necesarily part of this pull request, but the following code has a leak in it:
+ (NSString *)buildHostURL:(NSString *)customURLString
{
NSString* preparedHostName = nil;
if(customURLString == nil){
NSLog(@"No custom URL: defaulting to %@", defaultAppBladeHostURL);
preparedHostName = defaultAppBladeHostURL;
}
else
{
//build a request to check if the supplied url is valid
///////////////////////////////////////////////
// HERE!!! The Leak is HERE. You've got an alloc/init without an autorelease or release.
///////////////////////////////////////////////
NSURL *requestURL = [[NSURL alloc] initWithString:customURLString];
if(requestURL == nil)
{
NSLog(@"Could not parse given URL: %@ defaulting to %@", customURLString, defaultAppBladeHostURL);
preparedHostName = defaultAppBladeHostURL;
}
else
{
NSLog(@"Found custom URL %@", customURLString);
preparedHostName = customURLString;
}
}
NSLog(@"built host URL: %@", preparedHostName);
return preparedHostName;
}
There's also a leak in encodeBase64WithData. We need to call free(*objPointer)
after we construct the NSString we're currently returning.
Switched static string for boundaries into a randomized one for safety. Removed console logging in feedback due to extreme size. Feedback and Crashes now can take optional user-defined params out of a plist and send them to Appblade to be stored and viewed later.