Commit cc01dffa authored by Daniel Murphy's avatar Daniel Murphy Committed by Commit Bot

Fixed memory leak in InterfacePtrSet::RemovePtr

Bug: 840949
Change-Id: Ied53a2d1cccb0a0c474d8b9cfb76bad1a8d83987
Reviewed-on: https://chromium-review.googlesource.com/1050581
Commit-Queue: Daniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557618}
parent cc7bafbb
...@@ -77,8 +77,10 @@ class PtrSet { ...@@ -77,8 +77,10 @@ class PtrSet {
if (it == ptrs_.end()) if (it == ptrs_.end())
return Ptr<Interface>(); return Ptr<Interface>();
Ptr<Interface> ptr; Ptr<Interface> ptr;
if (it->second) if (it->second) {
ptr = it->second->Take(); ptr = it->second->Take();
delete it->second.get();
}
ptrs_.erase(it); ptrs_.erase(it);
return ptr; return ptr;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment