aboutsummaryrefslogtreecommitdiff
path: root/ssh/client_auth_test.go
diff options
context:
space:
mode:
authorDave Cheney <dave@cheney.net>2012-08-18 15:41:45 +1000
committerDave Cheney <dave@cheney.net>2012-08-18 15:41:45 +1000
commit096d0eae018b8e5d55a109ed511d21612c436cd6 (patch)
tree95efc30827f31efe978b5817e90aacab0c73e8dd /ssh/client_auth_test.go
parent7343d5f5849484ec61fca3e4a0e6c529e400aaa9 (diff)
downloadgo-x-crypto-096d0eae018b8e5d55a109ed511d21612c436cd6.tar.xz
go.crypto/ssh: fix misplaced defer
Fixes golang/go#3972. R=golang-dev, agl, r CC=golang-dev https://golang.org/cl/6448166
Diffstat (limited to 'ssh/client_auth_test.go')
-rw-r--r--ssh/client_auth_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ssh/client_auth_test.go b/ssh/client_auth_test.go
index 9d1ae2f..11c7227 100644
--- a/ssh/client_auth_test.go
+++ b/ssh/client_auth_test.go
@@ -160,7 +160,6 @@ func newMockAuthServer(t *testing.T) string {
go func() {
defer l.Close()
c, err := l.Accept()
- defer c.Close()
if err != nil {
t.Errorf("Unable to accept incoming connection: %v", err)
return
@@ -171,6 +170,7 @@ func newMockAuthServer(t *testing.T) string {
t.Logf("Handshaking error: %v", err)
return
}
+ defer c.Close()
}()
return l.Addr().String()
}