fix: memory leak issue with diff protocol (#1019)
This commit is contained in:
parent
cd46de9e0b
commit
dd3b3a69b5
@ -509,6 +509,7 @@ func (h *handler) runDiffExtension(peer *diff.Peer, handler diff.Handler) error
|
||||
|
||||
if err := h.peers.registerDiffExtension(peer); err != nil {
|
||||
peer.Log().Error("Diff extension registration failed", "err", err)
|
||||
peer.Close()
|
||||
return err
|
||||
}
|
||||
return handler(peer)
|
||||
|
@ -45,6 +45,7 @@ func (h *diffHandler) RunPeer(peer *diff.Peer, hand diff.Handler) error {
|
||||
wait <- peer
|
||||
}
|
||||
ps.lock.Unlock()
|
||||
peer.Close()
|
||||
return err
|
||||
}
|
||||
return (*handler)(h).runDiffExtension(peer, hand)
|
||||
|
Loading…
Reference in New Issue
Block a user