From 105632d35b7181298edeb557a23e66534203796f Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 24 Oct 2013 04:12:59 +1100 Subject: [PATCH] go.crypto/ssh: only close connection if it was open in TestClientUnsupportedKex. R=dave CC=golang-dev https://golang.org/cl/15450046 --- ssh/client_auth_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ssh/client_auth_test.go b/ssh/client_auth_test.go index a726595..f2fc9c6 100644 --- a/ssh/client_auth_test.go +++ b/ssh/client_auth_test.go @@ -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() } }