Fix memory leak in Qurl::toCFURL()

Release the temp CFString.

Change-Id: I8a5b8f18a42a4a9b2c6671f0f5b32a3f0b14238d
Task-number: QTBUG-43710
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Morten Johan Sørvig 2015-01-13 10:52:39 +01:00 committed by Jani Heikkinen
parent 128cab4635
commit 49fd3511f5

View File

@ -54,7 +54,13 @@ QUrl QUrl::fromCFURL(CFURLRef url)
CFURLRef QUrl::toCFURL() const
{
return CFURLCreateWithString(0, toString(FullyEncoded).toCFString(), 0);
CFURLRef url = 0;
CFStringRef str = toString(FullyEncoded).toCFString();
if (str) {
url = CFURLCreateWithString(0, str, 0);
CFRelease(str);
}
return url;
}
QUrl QUrl::fromNSURL(const NSURL *url)