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

Unified Diff: net/websockets/websocket_throttle.cc

Issue 364001: Fix memory leak in WebSocketThrottle. (Closed)
Patch Set: Created 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_throttle.cc
diff --git a/net/websockets/websocket_throttle.cc b/net/websockets/websocket_throttle.cc
index fb320b647f092c19915ad00612e040adcea4d148..d47d2e8242041d57b300ea8e947aeb92a5a126f5 100644
--- a/net/websockets/websocket_throttle.cc
+++ b/net/websockets/websocket_throttle.cc
@@ -244,8 +244,10 @@ void WebSocketThrottle::RemoveFromQueue(SocketStream* socket,
ConnectingQueue* queue = iter->second;
DCHECK(state == queue->front());
queue->pop_front();
- if (queue->empty())
+ if (queue->empty()) {
+ delete queue;
addr_map_.erase(iter);
+ }
}
for (ConnectingQueue::iterator iter = queue_.begin();
iter != queue_.end();
« 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