From: Volker Lendecke Date: Sat, 28 Apr 2007 13:52:49 +0000 (+0000) Subject: r22554: Fix an assumption that TALLOC_ARRAY(.., 0) != NULL. X-Git-Tag: samba-misc-tags/initial-v3-0-unstable~594 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1f15a8f371f7c56d1a6e67e52f0f184bbd270c84;p=thirdparty%2Fsamba.git r22554: Fix an assumption that TALLOC_ARRAY(.., 0) != NULL. Volker --- 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