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

Unified Diff: chrome/browser/policy/policy_map.cc

Issue 9950047: Fix leak in PolicyMap.FilterLevel. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 9 months 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: chrome/browser/policy/policy_map.cc
diff --git a/chrome/browser/policy/policy_map.cc b/chrome/browser/policy/policy_map.cc
index 25869e6a0e6d413129ca4b2590ff009fa1b3e743..70be9e5b56762122fbce9857c635f34be998fe30 100644
--- a/chrome/browser/policy/policy_map.cc
+++ b/chrome/browser/policy/policy_map.cc
@@ -122,10 +122,12 @@ void PolicyMap::GetDifferingKeys(const PolicyMap& other,
void PolicyMap::FilterLevel(PolicyLevel level) {
PolicyMapType::iterator iter(map_.begin());
while (iter != map_.end()) {
- if (iter->second.level != level)
+ if (iter->second.level != level) {
+ delete iter->second.value;
map_.erase(iter++);
- else
+ } else {
++iter;
+ }
}
}
« 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