s3:smbldap: free the idle event scheduled in smbldap_open in smbldap_close
authorGregor Beck <gbeck@sernet.de>
Tue, 21 Jun 2011 06:00:59 +0000 (08:00 +0200)
committerKarolin Seeger <kseeger@samba.org>
Tue, 26 Jul 2011 19:51:52 +0000 (21:51 +0200)
(cherry picked from commit 56e9ad4aa736875ac5666a9c3e33ae3d94fb2f5c)

source3/lib/smbldap.c

index 781857fa36e2bdfbf5e7b85c6798eee69dce87f4..7cd14848d6b4db941c3eed349ce0c5dd31c2a5eb 100644 (file)
@@ -1331,6 +1331,8 @@ static NTSTATUS smbldap_close(struct smbldap_state *ldap_state)
 
        smbldap_delete_state(ldap_state);
 
+       TALLOC_FREE(ldap_state->idle_event);
+
        DEBUG(5,("The connection to the LDAP server was closed\n"));
        /* maybe free the results here --metze */
 
@@ -1845,7 +1847,6 @@ void smbldap_free_struct(struct smbldap_state **ldap_state)
        SAFE_FREE((*ldap_state)->bind_dn);
        SAFE_FREE((*ldap_state)->bind_secret);
 
-       TALLOC_FREE((*ldap_state)->idle_event);
 
        *ldap_state = NULL;