summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2018-01-11 20:24:21 -0800
committerJake Petroules <jake.petroules@qt.io>2018-01-12 18:13:17 +0000
commit13c71ac816ce2f7fe864d6213b790a424d9a1664 (patch)
treef7209cda3a8e0ecd8a346b94d8ba7929ab70c679
parentab4cc83d5249ea0baed66ef86bff3c29c36e8c7d (diff)
Fix memory leak in QStandardPaths::displayName() on Apple platforms
Task-number: QTBUG-65687 Change-Id: Ie795c8ac715e36656dabcbcdf8976d303ebaf0d1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--src/corelib/io/qstandardpaths_mac.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qstandardpaths_mac.mm b/src/corelib/io/qstandardpaths_mac.mm
index e25339a7d1..ab73edb008 100644
--- a/src/corelib/io/qstandardpaths_mac.mm
+++ b/src/corelib/io/qstandardpaths_mac.mm
@@ -248,9 +248,9 @@ QString QStandardPaths::displayName(StandardLocation type)
if (QStandardPaths::ApplicationsLocation == type)
return QCoreApplication::translate("QStandardPaths", "Applications");
+ const QCFString fsPath(standardLocations(type).constFirst());
if (QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
- standardLocations(type).constFirst().toCFString(),
- kCFURLPOSIXPathStyle, true)) {
+ fsPath, kCFURLPOSIXPathStyle, true)) {
QCFString name;
CFURLCopyResourcePropertyForKey(url, kCFURLLocalizedNameKey, &name, NULL);
if (name && CFStringGetLength(name))