crypto/ssh: Handle error in dial to avoid a goroutine leak

If the channel open request failed, a nil channel would be provided to
DiscardRequests, which would never return.

We return the error early to avoid this goroutine leak.

Change-Id: I4c0e0a7698f7623c042f2a04941b8c50e8031d33
Reviewed-on: https://go-review.googlesource.com/13390
Reviewed-by: Dave Cheney <dave@cheney.net>
1 file changed