If String is null, createCFString() returns CFSTR(""). According to CFString.h, 'CFSTR(), not being a "Copy" or "Create" function, does not return a new reference for you. So, you should not release the return value.' I am not aware of any practical issues caused by this, but we should probably comply.
Created attachment 35051 [details] proposed patch
Comment on attachment 35051 [details] proposed patch > + * platform/text/cf/StringCF.cpp: (WebCore::String::createCFString): Rather than retain > + CFSTR result, we can just return a new string, this doesn't seem to be a hot code path Even though it's not a hot code path it seems like we should avoid the extra memory allocation that CFStringCreateWithCharacters does compared to CFSTR.
Comment on attachment 35051 [details] proposed patch If either solution is fine speed-wise, then why not call CFRetain to save memory in case a lot of these strings are kept around?
Committed revision 47449. > If either solution is fine speed-wise, then why not call CFRetain to save > memory in case a lot of these strings are kept around? OK, changed. /me doesn't like to share objects across threads.