Skip to content

Commit 26439f9

Browse files
committed
client: do not leak ssh processes on protocol errors
refs zrepl/zrepl#322
1 parent d9b26a4 commit 26439f9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dial.go

+2
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,11 @@ func Dial(dialCtx context.Context, endpoint Endpoint) (*SSHConn, error) {
315315
case bytes.Equal(resp, banner_msg):
316316
break
317317
case bytes.Equal(resp, proxy_error_msg):
318+
_ = cmdWaitErrOrIOErr(nil, "")
318319
confErrChan <- ProtocolError{"proxy error, check remote configuration"}
319320
return
320321
default:
322+
_ = cmdWaitErrOrIOErr(nil, "")
321323
confErrChan <- ProtocolError{fmt.Sprintf("unknown banner message: %v", resp)}
322324
return
323325
}

0 commit comments

Comments
 (0)