Skip to content

Commit 2ff3cb3

Browse files
Adrian Serranomaddyblue
Adrian Serrano
authored andcommitted
Fix connection leak on SSL failure
When connecting to a server using SSL fails (i.e. with SSL disabled) the connection was never freed. Fixes #840
1 parent ceb88a0 commit 2ff3cb3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

conn.go

+3
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ func (c *Connector) open(ctx context.Context) (cn *conn, err error) {
301301

302302
err = cn.ssl(o)
303303
if err != nil {
304+
if cn.c != nil {
305+
cn.c.Close()
306+
}
304307
return nil, err
305308
}
306309

0 commit comments

Comments
 (0)