diff --git a/conn.go b/conn.go index df2dab22..3aa07ca3 100644 --- a/conn.go +++ b/conn.go @@ -299,6 +299,9 @@ func (c *Connector) open(ctx context.Context) (cn *conn, err error) { err = cn.ssl(o) if err != nil { + if cn.c != nil { + cn.c.Close() + } return nil, err }