s3:smbldap: free the idle event scheduled in smbldap_open in smbldap_close
[ira/wip.git] / 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;