Skip to content

Commit

Permalink
Fix memory leak in Server.connectedPeers
Browse files Browse the repository at this point in the history
  • Loading branch information
whunmr authored and whitefen committed Dec 19, 2018
1 parent 5b322a9 commit c791683
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1429,6 +1429,8 @@ func (s *Server) handleDonePeerMsg(state *peerState, sp *serverPeer) {

// If we get here it means that either we didn't know about the peer
// or we purposefully deleted it.

delete(s.connectedPeers, sp.Addr())
}

// handleBanPeerMsg deals with banning peers. It is invoked from the
Expand Down Expand Up @@ -2047,6 +2049,7 @@ func (s *Server) peerDoneHandler(sp *serverPeer) {
log.Debug("Evicted %d from peer %v (id %d)", numEvicted, sp, sp.ID())
}
}

close(sp.quit)
}

Expand Down

0 comments on commit c791683

Please sign in to comment.