]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r15542: Close the LDAP connection and free the struct, regardless whether the
authorGünther Deschner <gd@samba.org>
Fri, 12 May 2006 13:29:51 +0000 (13:29 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:16:57 +0000 (11:16 -0500)
simple bind operation was successful or not.

Guenther
(This used to be commit e4734cb99cae189edf49c4d8f4e4324f5c51f443)

source3/passdb/pdb_nds.c

index a82f4e48d4ee35c5c7378eeacd44a073ff4792f3..08ad96efa4b9fc459e2eaa25b00e3f38dc6ae1bd 100644 (file)
@@ -817,9 +817,9 @@ static NTSTATUS pdb_nds_update_login_attempts(struct pdb_methods *methods,
 
                        /* Attempt simple bind with real or bogus password */
                        rc = ldap_simple_bind_s(ld, dn, clear_text_pw);
+                       ldap_unbind(ld);
                        if (rc == LDAP_SUCCESS) {
                                DEBUG(5,("pdb_nds_update_login_attempts: ldap_simple_bind_s Successful for %s\n", username));
-                               ldap_unbind(ld);
                        } else {
                                NTSTATUS nt_status = NT_STATUS_ACCOUNT_RESTRICTION;
                                DEBUG(5,("pdb_nds_update_login_attempts: ldap_simple_bind_s Failed for %s\n", username));