mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Don't leak ssh connections
Without this fix, the underlying network connection is never closed.
This commit is contained in:
@@ -190,6 +190,7 @@ func runSSHCommand(dialer sshDialer, cmd, user, host string, signer ssh.Signer,
|
||||
if err != nil {
|
||||
return "", "", 0, fmt.Errorf("error getting SSH client to %s@%s: '%v'", user, host, err)
|
||||
}
|
||||
defer client.Close()
|
||||
session, err := client.NewSession()
|
||||
if err != nil {
|
||||
return "", "", 0, fmt.Errorf("error creating session to %s@%s: '%v'", user, host, err)
|
||||
|
Reference in New Issue
Block a user