Skip to content

Commit

Permalink
Fix goroutine leak in ssh-tunnel healthcheck.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcullen committed Apr 19, 2016
1 parent 4638f2f commit cba5e84
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/ssh/ssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,12 @@ func (l *SSHTunnelList) healthCheck(e sshTunnelEntry) error {
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
})
client := &http.Client{Transport: transport}
_, err := client.Get(l.healthCheckURL.String())
return err
resp, err := client.Get(l.healthCheckURL.String())
if err != nil {
return err
}
resp.Body.Close()
return nil
}

func (l *SSHTunnelList) removeAndReAdd(e sshTunnelEntry) {
Expand Down

0 comments on commit cba5e84

Please sign in to comment.