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

Unified Diff: chrome/browser/content_settings/host_content_settings_map.cc

Issue 8592001: Valgrind: Fix a leak in ContentSettingsProvider. (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 | « chrome/browser/content_settings/content_settings_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/content_settings/host_content_settings_map.cc
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc
index db119abc12f8dc404449aad34188db3939c7db7a..fe8fe1eaba0a5db2981ac0f61dab78bc4530f07d 100644
--- a/chrome/browser/content_settings/host_content_settings_map.cc
+++ b/chrome/browser/content_settings/host_content_settings_map.cc
@@ -211,12 +211,11 @@ void HostContentSettingsMap::SetDefaultContentSetting(
DCHECK(IsSettingAllowedForType(setting, content_type));
base::Value* value = Value::CreateIntegerValue(setting);
- content_settings_providers_[DEFAULT_PROVIDER]->SetWebsiteSetting(
- ContentSettingsPattern::Wildcard(),
- ContentSettingsPattern::Wildcard(),
- content_type,
- std::string(),
- value);
+ if (!content_settings_providers_[DEFAULT_PROVIDER]->SetWebsiteSetting(
+ ContentSettingsPattern::Wildcard(), ContentSettingsPattern::Wildcard(),
+ content_type, std::string(), value)) {
+ delete value;
+ }
}
void HostContentSettingsMap::SetWebsiteSetting(
« no previous file with comments | « chrome/browser/content_settings/content_settings_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698