diff options
author | Jeremy Allison <jra@samba.org> | 2007-04-30 02:39:34 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:49 -0500 |
commit | be8b0685a55700c6bce3681734800ec6434b0364 (patch) | |
tree | 8616d85686fb147d431eeea435233f45d5ee8d41 /source3/nsswitch/winbindd_passdb.c | |
parent | 79de0ad9463a5cd64978beae37df79fbb4f74632 (diff) | |
download | samba-be8b0685a55700c6bce3681734800ec6434b0364.tar.gz samba-be8b0685a55700c6bce3681734800ec6434b0364.tar.bz2 samba-be8b0685a55700c6bce3681734800ec6434b0364.zip |
r22589: Make TALLOC_ARRAY consistent across all uses.
Jeremy.
(This used to be commit 8968808c3b5b0208cbad9ac92eaf948f2c546dd9)
Diffstat (limited to 'source3/nsswitch/winbindd_passdb.c')
-rw-r--r-- | source3/nsswitch/winbindd_passdb.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source3/nsswitch/winbindd_passdb.c b/source3/nsswitch/winbindd_passdb.c index 04d8f58884..e8b0ae641f 100644 --- a/source3/nsswitch/winbindd_passdb.c +++ b/source3/nsswitch/winbindd_passdb.c @@ -402,13 +402,19 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain, return nt_status; } - *names = TALLOC_ARRAY(mem_ctx, char *, *num_domains); - *alt_names = TALLOC_ARRAY(mem_ctx, char *, *num_domains); - *dom_sids = TALLOC_ARRAY(mem_ctx, DOM_SID, *num_domains); + if (*num_domains) { + *names = TALLOC_ARRAY(mem_ctx, char *, *num_domains); + *alt_names = TALLOC_ARRAY(mem_ctx, char *, *num_domains); + *dom_sids = TALLOC_ARRAY(mem_ctx, DOM_SID, *num_domains); - if ((*alt_names == NULL) || (*names == NULL) || (*dom_sids == NULL)) { - TALLOC_FREE(tmp_ctx); - return NT_STATUS_NO_MEMORY; + if ((*alt_names == NULL) || (*names == NULL) || (*dom_sids == NULL)) { + TALLOC_FREE(tmp_ctx); + return NT_STATUS_NO_MEMORY; + } + } else { + *names = NULL; + *alt_names = NULL; + *dom_sids = NULL; } for (i=0; i<*num_domains; i++) { |