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)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 Jul 2011 09:23:43 +0000 (11:23 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
source3/lib/smbldap.c

index 3d159d73d950fd21745beb3a72a33d703624689e..76d2899e501995ec03db57ddcf141c2a3f21b95d 100644 (file)
@@ -1332,6 +1332,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 */
 
@@ -1846,7 +1848,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;