summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ldap.c22
-rw-r--r--source3/passdb/secrets.c8
2 files changed, 15 insertions, 15 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index b706721e77..35ce8bb41a 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -1711,22 +1711,22 @@ static NTSTATUS ldapsam_modify_entry(struct pdb_methods *my_methods,
}
}
- if (!push_utf8_allocate(&utf8_password,
+ if (!push_utf8_talloc(talloc_tos(), &utf8_password,
pdb_get_plaintext_passwd(newpwd),
&converted_size))
{
return NT_STATUS_NO_MEMORY;
}
- if (!push_utf8_allocate(&utf8_dn, dn, &converted_size)) {
- SAFE_FREE(utf8_password);
+ if (!push_utf8_talloc(talloc_tos(), &utf8_dn, dn, &converted_size)) {
+ TALLOC_FREE(utf8_password);
return NT_STATUS_NO_MEMORY;
}
if ((ber = ber_alloc_t(LBER_USE_DER))==NULL) {
DEBUG(0,("ber_alloc_t returns NULL\n"));
- SAFE_FREE(utf8_password);
- SAFE_FREE(utf8_dn);
+ TALLOC_FREE(utf8_password);
+ TALLOC_FREE(utf8_dn);
return NT_STATUS_UNSUCCESSFUL;
}
@@ -1736,21 +1736,21 @@ static NTSTATUS ldapsam_modify_entry(struct pdb_methods *my_methods,
(ber_printf (ber, "n}") < 0)) {
DEBUG(0,("ldapsam_modify_entry: ber_printf returns a value <0\n"));
ber_free(ber,1);
- SAFE_FREE(utf8_dn);
- SAFE_FREE(utf8_password);
+ TALLOC_FREE(utf8_dn);
+ TALLOC_FREE(utf8_password);
return NT_STATUS_UNSUCCESSFUL;
}
if ((rc = ber_flatten (ber, &bv))<0) {
DEBUG(0,("ldapsam_modify_entry: ber_flatten returns a value <0\n"));
ber_free(ber,1);
- SAFE_FREE(utf8_dn);
- SAFE_FREE(utf8_password);
+ TALLOC_FREE(utf8_dn);
+ TALLOC_FREE(utf8_password);
return NT_STATUS_UNSUCCESSFUL;
}
- SAFE_FREE(utf8_dn);
- SAFE_FREE(utf8_password);
+ TALLOC_FREE(utf8_dn);
+ TALLOC_FREE(utf8_password);
ber_free(ber, 1);
if (!ldap_state->is_nds_ldap) {
diff --git a/source3/passdb/secrets.c b/source3/passdb/secrets.c
index 8e64a49e22..2b507d0c4d 100644
--- a/source3/passdb/secrets.c
+++ b/source3/passdb/secrets.c
@@ -720,7 +720,7 @@ bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
struct trusted_dom_pass pass;
ZERO_STRUCT(pass);
- if (!push_ucs2_allocate(&uni_dom_name, domain, &converted_size)) {
+ if (!push_ucs2_talloc(talloc_tos(), &uni_dom_name, domain, &converted_size)) {
DEBUG(0, ("Could not convert domain name %s to unicode\n",
domain));
return False;
@@ -728,7 +728,7 @@ bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
strncpy_w(pass.uni_name, uni_dom_name, sizeof(pass.uni_name) - 1);
pass.uni_name_len = strlen_w(uni_dom_name)+1;
- SAFE_FREE(uni_dom_name);
+ TALLOC_FREE(uni_dom_name);
/* last change time */
pass.mod_time = time(NULL);
@@ -742,14 +742,14 @@ bool secrets_store_trusted_domain_password(const char* domain, const char* pwd,
/* Calculate the length. */
pass_len = tdb_trusted_dom_pass_pack(NULL, 0, &pass);
- pass_buf = SMB_MALLOC_ARRAY(uint8, pass_len);
+ pass_buf = talloc_array(talloc_tos(), uint8, pass_len);
if (!pass_buf) {
return false;
}
pass_len = tdb_trusted_dom_pass_pack(pass_buf, pass_len, &pass);
ret = secrets_store(trustdom_keystr(domain), (void *)pass_buf,
pass_len);
- SAFE_FREE(pass_buf);
+ TALLOC_FREE(pass_buf);
return ret;
}