Close connection when SSH handshake fails.
This commit is contained in:
@@ -419,6 +419,8 @@ func (d *sshClient) dialRemote(
|
|||||||
c, chans, reqs, err := ssh.NewClientConn(&sshConn, addr, config)
|
c, chans, reqs, err := ssh.NewClientConn(&sshConn, addr, config)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
sshConn.Close()
|
||||||
|
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user