diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-04-23 18:07:01 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:56:41 -0500 |
commit | 2e0cac8e3eb021aa8f5cad4ce8b72f98036af639 (patch) | |
tree | c2a8ad74f394b8c7a7a6286697a5edf91ef6611f /source3/sam | |
parent | 57eb9f47d058cc3c841aca11404bae2fed5367e4 (diff) | |
download | samba-2e0cac8e3eb021aa8f5cad4ce8b72f98036af639.tar.gz samba-2e0cac8e3eb021aa8f5cad4ce8b72f98036af639.tar.bz2 samba-2e0cac8e3eb021aa8f5cad4ce8b72f98036af639.zip |
r6445: Make us survive the PARANOID_MALLOC_CHECKER. Should we enable that for
--enable-developer=yes?
Volker
(This used to be commit 61d40ac60dd9c8c9bbcf92e4fc57fe1d706bc721)
Diffstat (limited to 'source3/sam')
-rw-r--r-- | source3/sam/idmap_rid.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/sam/idmap_rid.c b/source3/sam/idmap_rid.c index 48e496b4b7..4f28f9e1af 100644 --- a/source3/sam/idmap_rid.c +++ b/source3/sam/idmap_rid.c @@ -81,7 +81,8 @@ static NTSTATUS rid_idmap_parse(const char *init_param, DEBUG(3,("rid_idmap_parse: parsing entry: %d\n", trust.number)); /* reinit sizes */ - trust.dom = (struct dom_entry *) realloc(trust.dom, sizeof(struct dom_entry)*(trust.number+1)); + trust.dom = SMB_REALLOC_ARRAY(trust.dom, struct dom_entry, + trust.number+1); if ( trust.dom == NULL ) { return NT_STATUS_NO_MEMORY; @@ -163,8 +164,8 @@ static NTSTATUS rid_idmap_get_domains(uint32 *num_domains, fstring **domain_name /* put the results together */ *num_domains = 1; - *domain_names = (fstring *) malloc(sizeof(fstring) * *num_domains); - *domain_sids = (DOM_SID *) malloc(sizeof(DOM_SID) * *num_domains); + *domain_names = SMB_MALLOC_ARRAY(fstring, *num_domains); + *domain_sids = SMB_MALLOC_ARRAY(DOM_SID, *num_domains); /* avoid calling a DC when trusted domains are not allowed anyway */ if (!lp_allow_trusted_domains()) { @@ -276,8 +277,9 @@ static NTSTATUS rid_idmap_get_domains(uint32 *num_domains, fstring **domain_name /* put the results together */ *num_domains = trusted_num_domains + own_domains; - *domain_names = (fstring *) realloc(*domain_names, sizeof(fstring) * *num_domains); - *domain_sids = (DOM_SID *) realloc(*domain_sids, sizeof(DOM_SID) * *num_domains); + *domain_names = SMB_REALLOC_ARRAY(*domain_names, fstring, + *num_domains); + *domain_sids = SMB_REALLOC_ARRAY(*domain_sids, DOM_SID, *num_domains); /* first add mydomain */ fstrcpy((*domain_names)[0], domain_name); @@ -352,7 +354,7 @@ static NTSTATUS rid_idmap_init(char *init_param) } /* init sizes */ - trust.dom = (struct dom_entry *) malloc(sizeof(struct dom_entry)); + trust.dom = SMB_MALLOC_P(struct dom_entry); if (trust.dom == NULL) { return NT_STATUS_NO_MEMORY; } |