From 13c71ac816ce2f7fe864d6213b790a424d9a1664 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 11 Jan 2018 20:24:21 -0800 Subject: Fix memory leak in QStandardPaths::displayName() on Apple platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-65687 Change-Id: Ie795c8ac715e36656dabcbcdf8976d303ebaf0d1 Reviewed-by: Timur Pocheptsov Reviewed-by: Tor Arne Vestbø --- src/corelib/io/qstandardpaths_mac.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/io/qstandardpaths_mac.mm') 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 url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, - standardLocations(type).constFirst().toCFString(), - kCFURLPOSIXPathStyle, true)) { + fsPath, kCFURLPOSIXPathStyle, true)) { QCFString name; CFURLCopyResourcePropertyForKey(url, kCFURLLocalizedNameKey, &name, NULL); if (name && CFStringGetLength(name)) -- cgit v1.2.3