go.crypto/ssh: only close connection if it was open in TestClientUnsupportedKex.

R=dave
CC=golang-dev
https://golang.org/cl/15450046
This commit is contained in:
Han-Wen Nienhuys
2013-10-24 04:12:59 +11:00
committed by Dave Cheney
parent 94779a0cf1
commit 105632d35b
+2
View File
@@ -361,6 +361,8 @@ func TestClientUnsupportedKex(t *testing.T) {
c, err := Dial("tcp", newMockAuthServer(t), config)
if err == nil || !strings.Contains(err.Error(), "no common algorithms") {
t.Errorf("got %v, expected 'no common algorithms'", err)
}
if c != nil {
c.Close()
}
}