fixes #546 - ldap hang

This commit is contained in:
angelnu 2022-10-26 23:18:27 +00:00
parent dbf14fa083
commit b98a283cc3

View file

@ -183,6 +183,7 @@ func (a *Auth) getConn() (*ldap.Conn, error) {
if a.conn == nil { if a.conn == nil {
conn, err := a.newConn() conn, err := a.newConn()
if err != nil { if err != nil {
a.connLock.Unlock()
return nil, err return nil, err
} }
a.conn = conn a.conn = conn
@ -191,6 +192,7 @@ func (a *Auth) getConn() (*ldap.Conn, error) {
a.conn.Close() a.conn.Close()
conn, err := a.newConn() conn, err := a.newConn()
if err != nil { if err != nil {
a.connLock.Unlock()
return nil, err return nil, err
} }
a.conn = conn a.conn = conn