summaryrefslogtreecommitdiff
path: root/source3/groupdb
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-12-07 18:25:53 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:32 -0500
commitacf9d61421faa6c0055d57fdee7db300dc5431aa (patch)
tree5482afecfe9b4a68b9a1f18d541a3109f8143ab7 /source3/groupdb
parent3bd3be97dc8a581c0502410453091c195e322766 (diff)
downloadsamba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.gz
samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.tar.bz2
samba-acf9d61421faa6c0055d57fdee7db300dc5431aa.zip
r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
Diffstat (limited to 'source3/groupdb')
-rw-r--r--source3/groupdb/mapping.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/groupdb/mapping.c b/source3/groupdb/mapping.c
index 072304ed18..7095997dc8 100644
--- a/source3/groupdb/mapping.c
+++ b/source3/groupdb/mapping.c
@@ -469,7 +469,7 @@ static BOOL enum_group_mapping(enum SID_NAME_USE sid_name_use, GROUP_MAP **rmap,
decode_sid_name_use(group_type, map.sid_name_use);
DEBUG(11,("enum_group_mapping: returning group %s of type %s\n", map.nt_name ,group_type));
- mapt=(GROUP_MAP *)Realloc((*rmap), (entries+1)*sizeof(GROUP_MAP));
+ mapt= SMB_REALLOC_ARRAY((*rmap), GROUP_MAP, entries+1);
if (!mapt) {
DEBUG(0,("enum_group_mapping: Unable to enlarge group map!\n"));
SAFE_FREE(*rmap);
@@ -613,7 +613,7 @@ static NTSTATUS add_aliasmem(const DOM_SID *alias, const DOM_SID *member)
asprintf(&new_memberstring, "%s %s", (char *)(dbuf.dptr),
string_sid);
} else {
- new_memberstring = strdup(string_sid);
+ new_memberstring = SMB_STRDUP(string_sid);
}
if (new_memberstring == NULL)
@@ -753,7 +753,7 @@ static NTSTATUS del_aliasmem(const DOM_SID *alias, const DOM_SID *member)
return tdb_delete(tdb, kbuf) == 0 ?
NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL;
- member_string = strdup("");
+ member_string = SMB_STRDUP("");
if (member_string == NULL) {
SAFE_FREE(sids);
@@ -1292,7 +1292,7 @@ NTSTATUS pdb_default_enum_aliases(struct pdb_methods *methods,
if (*num_aliases > max_entries)
*num_aliases = max_entries;
- *info = malloc(sizeof(struct acct_info) * (*num_aliases));
+ *info = SMB_MALLOC_ARRAY(struct acct_info, *num_aliases);
for (i=0; i<*num_aliases; i++) {
fstrcpy((*info)[i].acct_name, map[i+start_idx].nt_name);