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

Unified Diff: mojo/public/cpp/bindings/remote_ptr.h

Issue 269893003: Fix leak in RemotePtr::operator=(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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: mojo/public/cpp/bindings/remote_ptr.h
diff --git a/mojo/public/cpp/bindings/remote_ptr.h b/mojo/public/cpp/bindings/remote_ptr.h
index 63ee719329544c2d314836fb2744770b522bca6c..9f7922615458316e89bc0cdd03fd9b16ffa12277 100644
--- a/mojo/public/cpp/bindings/remote_ptr.h
+++ b/mojo/public/cpp/bindings/remote_ptr.h
@@ -86,6 +86,7 @@ class RemotePtr {
// Move-only constructor and operator=.
RemotePtr(RValue other) : state_(other.object->release()) {}
RemotePtr& operator=(RValue other) {
+ delete state_;
state_ = other.object->release();
return *this;
}
« 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