Commit aa6a5fa2 authored by Jeff Mitchell's avatar Jeff Mitchell
Browse files

Fix potential error scoping issue.

Ping #1262
parent 61a4f4a6
No related merge requests found
Showing with 3 additions and 2 deletions
+3 -2
......@@ -243,6 +243,7 @@ func (c *ConfigEntry) DialLDAP() (*ldap.Conn, error) {
}
var conn *ldap.Conn
var tlsConfig *tls.Config
switch u.Scheme {
case "ldap":
if port == "" {
......@@ -250,7 +251,7 @@ func (c *ConfigEntry) DialLDAP() (*ldap.Conn, error) {
}
conn, err = ldap.Dial("tcp", host+":"+port)
if c.StartTLS {
tlsConfig, err := c.GetTLSConfig(host)
tlsConfig, err = c.GetTLSConfig(host)
if err != nil {
break
}
......@@ -260,7 +261,7 @@ func (c *ConfigEntry) DialLDAP() (*ldap.Conn, error) {
if port == "" {
port = "636"
}
tlsConfig, err := c.GetTLSConfig(host)
tlsConfig, err = c.GetTLSConfig(host)
if err != nil {
break
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment