From: Günther Deschner Date: Tue, 20 Oct 2009 16:35:16 +0000 (+0200) Subject: s3-pdb_ldap: fix crash bug in ldapsam_set_trusteddom_pw(). X-Git-Tag: tdb-1.2.0~608 X-Git-Url: http://git.samba.org/samba.git/?p=ira%2Fwip.git;a=commitdiff_plain;h=d168d7fe3c7ec4b90cd526c4ea02e972ffac7835;ds=sidebyside s3-pdb_ldap: fix crash bug in ldapsam_set_trusteddom_pw(). Thanks Volker for the hint. Guenther --- diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c index 2c8d0518d55..c464a88f38c 100644 --- a/source3/passdb/pdb_ldap.c +++ b/source3/passdb/pdb_ldap.c @@ -6013,8 +6013,6 @@ static bool ldapsam_set_trusteddom_pw(struct pdb_methods *methods, smbldap_make_mod(priv2ld(ldap_state), entry, &mods, "sambaClearTextPassword", pwd); - talloc_autofree_ldapmod(talloc_tos(), mods); - if (entry != NULL) { prev_pwd = smbldap_talloc_single_attribute(priv2ld(ldap_state), entry, "sambaClearTextPassword", talloc_tos()); @@ -6025,6 +6023,8 @@ static bool ldapsam_set_trusteddom_pw(struct pdb_methods *methods, } } + talloc_autofree_ldapmod(talloc_tos(), mods); + trusted_dn = trusteddom_dn(ldap_state, domain); if (trusted_dn == NULL) { return False;