summaryrefslogtreecommitdiffstats
path: root/base/mac
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-16 21:48:26 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-16 21:48:26 +0000
commit1562042283de1138d4386d1fea05d9028fbc8b0c (patch)
tree33a5c3595b8acab3881c14ea721413ae718f86e9 /base/mac
parent0da6b4455b596572e379c150aa5babf8d6364833 (diff)
downloadchromium_src-1562042283de1138d4386d1fea05d9028fbc8b0c.zip
chromium_src-1562042283de1138d4386d1fea05d9028fbc8b0c.tar.gz
chromium_src-1562042283de1138d4386d1fea05d9028fbc8b0c.tar.bz2
Valgrind: Fix a leak in GetValueFromDictionary for cocoa.
BUG=none TEST=none R=mark@chromium.org Review URL: http://codereview.chromium.org/8513019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/mac')
-rw-r--r--base/mac/foundation_util.mm6
1 files changed, 4 insertions, 2 deletions
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
index 44b81d3..6778c98 100644
--- a/base/mac/foundation_util.mm
+++ b/base/mac/foundation_util.mm
@@ -238,10 +238,12 @@ CFTypeRef GetValueFromDictionary(CFDictionaryRef dict,
return value;
if (CFGetTypeID(value) != expected_type) {
- std::string expected_type_name = base::SysCFStringRefToUTF8(
+ ScopedCFTypeRef<CFStringRef> expected_type_name(
CFCopyTypeIDDescription(expected_type));
+ std::string expected_type_utf8 =
+ base::SysCFStringRefToUTF8(expected_type_name);
DLOG(WARNING) << GetValueFromDictionaryErrorMessage(key,
- expected_type_name,
+ expected_type_utf8,
value);
return NULL;
}