vimalmishra09 / oauthconsumer

Automatically exported from code.google.com/p/oauthconsumer
0 stars 0 forks source link

Crash in OAMutableURLRequest #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
It’s hard to say exactly what conditions lead up to this, but we’re seeing 
intermittent crashing in OAMutableURLRequest.

What is the expected output? What do you see instead?
Expected: it works
Instead, it crashes on CFRelease()

What version of the product are you using? On what operating system?
The version included in https://github.com/bengottlieb/Twitter-OAuth-iPhone

Please provide any additional information below.
I believe the crash is related to this line (in my code, line 287 of 
OAMutableURLRequest.m, in the method -URLEncodedString:):

    CFRelease(preprocessedString);

Since CFURLCreateStringByReplacingPercentEscapesUsingEncoding() can return NULL 
if it fails, this line should be changed to:

    if (preprocessedString != NULL) {
        CFRelease(preprocessedString);
    }

That should safeguard against CFRelease() crashing. We’re currently testing 
this change in our code.

Original issue reported on code.google.com by Slauncha...@gmail.com on 17 Jan 2012 at 5:45