diff options
author | Gerald Carter <jerry@samba.org> | 2004-12-16 12:30:49 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2004-12-16 12:30:49 +0000 |
commit | 8d91e07ef22ad3ed484b04bc4968380a24940696 (patch) | |
tree | b5b8989f8da9ef7f852081f0460995386edd4b5d /source/passdb/pdb_ldap.c | |
parent | 1a878c865637feb80206c0dc599acebf7f4a46bd (diff) | |
download | samba-3.0.10.tar.gz samba-3.0.10.tar.xz samba-3.0.10.zip |
r4231: commiting changes to 3.0.10samba-3.0.10
Diffstat (limited to 'source/passdb/pdb_ldap.c')
-rw-r--r-- | source/passdb/pdb_ldap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/passdb/pdb_ldap.c b/source/passdb/pdb_ldap.c index f7ee8dcb42d..9659cbd5652 100644 --- a/source/passdb/pdb_ldap.c +++ b/source/passdb/pdb_ldap.c @@ -730,7 +730,7 @@ static BOOL init_sam_from_ldap (struct ldapsam_privates *ldap_state, /* We can only store (sizeof(pstring)-1)/64 password history entries. */ pwHistLen = MIN(pwHistLen, ((sizeof(temp)-1)/64)); - if ((pwhist = malloc(pwHistLen * PW_HISTORY_ENTRY_LEN)) == NULL){ + if ((pwhist = SMB_MALLOC(pwHistLen * PW_HISTORY_ENTRY_LEN)) == NULL){ DEBUG(0, ("init_sam_from_ldap: malloc failed!\n")); return False; } @@ -1266,9 +1266,9 @@ static void append_attr(char ***attr_list, const char *new_attr) ; } - (*attr_list) = Realloc((*attr_list), sizeof(**attr_list) * (i+2)); + (*attr_list) = SMB_REALLOC_ARRAY((*attr_list), char *, i+2); SMB_ASSERT((*attr_list) != NULL); - (*attr_list)[i] = strdup(new_attr); + (*attr_list)[i] = SMB_STRDUP(new_attr); (*attr_list)[i+1] = NULL; } @@ -2535,7 +2535,7 @@ static NTSTATUS ldapsam_enum_group_mapping(struct pdb_methods *methods, continue; } - mapt=(GROUP_MAP *)Realloc((*rmap), (entries+1)*sizeof(GROUP_MAP)); + mapt=SMB_REALLOC_ARRAY((*rmap), GROUP_MAP, entries+1); if (!mapt) { DEBUG(0,("ldapsam_enum_group_mapping: Unable to enlarge group map!\n")); SAFE_FREE(*rmap); @@ -2859,7 +2859,7 @@ static NTSTATUS pdb_init_ldapsam_common(PDB_CONTEXT *pdb_context, PDB_METHODS ** /* TODO: Setup private data and free */ - ldap_state = talloc_zero(pdb_context->mem_ctx, sizeof(*ldap_state)); + ldap_state = TALLOC_ZERO_P(pdb_context->mem_ctx, struct ldapsam_privates); if (!ldap_state) { DEBUG(0, ("pdb_init_ldapsam_common: talloc() failed for ldapsam private_data!\n")); return NT_STATUS_NO_MEMORY; |