Details
-
Bug
-
Resolution: Done
-
P2: Important
-
None
-
5.9.3, 5.10.0
-
None
-
macOS 10.12.6
-
13c71ac816ce2f7fe864d6213b790a424d9a1664
Description
QStandardPaths::displayName() function in qtbase/src/corelib/io/qstandardpaths_mac.mm leaks CFString instance in following block of code (line 235):
if (QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, standardLocations(type).constFirst().toCFString(), kCFURLPOSIXPathStyle, true)) { QCFString name; CFURLCopyResourcePropertyForKey(url, kCFURLLocalizedNameKey, &name, NULL); if (name && CFStringGetLength(name)) return QString::fromCFString(name); }
calling standardLocations(type).constFirst().toCFString() passes ownership of the string to the caller but the caller does not release the string.