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

Unified Diff: net/socket/client_socket_pool_base.cc

Issue 150196: Fix leak on connection error. (Closed)
Patch Set: Created 11 years, 6 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: net/socket/client_socket_pool_base.cc
diff --git a/net/socket/client_socket_pool_base.cc b/net/socket/client_socket_pool_base.cc
index 56eb1ab7a81f98495b559fd6935573ff509374dc..2a32e4d1fda6ddafc416a49e1198b5979a938d67 100644
--- a/net/socket/client_socket_pool_base.cc
+++ b/net/socket/client_socket_pool_base.cc
@@ -303,7 +303,7 @@ void ClientSocketPoolBase::OnConnectJobComplete(int result, ConnectJob* job) {
request_map->erase(it);
DCHECK_EQ(handle, job->key_handle());
- ClientSocket* const socket = job->ReleaseSocket();
+ scoped_ptr<ClientSocket> socket(job->ReleaseSocket());
RemoveConnectJob(job->key_handle());
if (result != OK) {
@@ -312,7 +312,7 @@ void ClientSocketPoolBase::OnConnectJobComplete(int result, ConnectJob* job) {
// |group_map_| again.
MaybeOnAvailableSocketSlot(group_name);
} else {
- HandOutSocket(socket, false /* not reused */, handle, &group);
+ HandOutSocket(socket.release(), false /* not reused */, handle, &group);
callback->Run(result);
}
}
« 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