Skip to content

Commit 5949f97

Browse files
committed
sshd: Close connection on failed handshake
Hopefully fixed #315
1 parent 67163a9 commit 5949f97

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sshd/net.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ func (l *SSHListener) Serve() {
5959
term, err := l.handleConn(conn)
6060
if err != nil {
6161
logger.Printf("[%s] Failed to handshake: %s", conn.RemoteAddr(), err)
62+
conn.Close() // Must be closed to avoid a leak
6263
return
6364
}
6465
l.HandlerFunc(term)

0 commit comments

Comments
 (0)