Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2167)

Unified Diff: base/mac/foundation_util.mm

Issue 8513019: Valgrind: Fix a leak in GetValueFromDictionary for cocoa. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/mac/foundation_util.mm
diff --git a/base/mac/foundation_util.mm b/base/mac/foundation_util.mm
index 44b81d32e5d5b1226c1dfc91514b4db9776c146b..6778c983a72c4c79920d7a7a97744182f72fd243 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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698