summaryrefslogtreecommitdiffstats
path: root/source/groupdb
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2007-04-28 13:52:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:44 -0500
commit1f15a8f371f7c56d1a6e67e52f0f184bbd270c84 (patch)
treed2a28feeaf932114a08d214cdd6ea8fa93df5747 /source/groupdb
parent561f3c67f40ed6a983ebf170e4014b256ca71219 (diff)
downloadsamba-1f15a8f371f7c56d1a6e67e52f0f184bbd270c84.tar.gz
samba-1f15a8f371f7c56d1a6e67e52f0f184bbd270c84.tar.xz
samba-1f15a8f371f7c56d1a6e67e52f0f184bbd270c84.zip
r22554: Fix an assumption that TALLOC_ARRAY(.., 0) != NULL.
Volker
Diffstat (limited to 'source/groupdb')
-rw-r--r--source/groupdb/mapping.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/groupdb/mapping.c b/source/groupdb/mapping.c
index 54cffd15882..46e27d4de68 100644
--- a/source/groupdb/mapping.c
+++ b/source/groupdb/mapping.c
@@ -578,12 +578,17 @@ NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods,
if (!NT_STATUS_IS_OK(result))
return result;
+ *p_num_alias_rids = 0;
+
+ if (num_alias_sids == 0) {
+ TALLOC_FREE(alias_sids);
+ return NT_STATUS_OK;
+ }
+
*pp_alias_rids = TALLOC_ARRAY(mem_ctx, uint32, num_alias_sids);
if (*pp_alias_rids == NULL)
return NT_STATUS_NO_MEMORY;
- *p_num_alias_rids = 0;
-
for (i=0; i<num_alias_sids; i++) {
if (!sid_peek_check_rid(domain_sid, &alias_sids[i],
&(*pp_alias_rids)[*p_num_alias_rids]))