summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_client/cli_ds.c')
-rw-r--r--source3/rpc_client/cli_ds.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_ds.c b/source3/rpc_client/cli_ds.c
index c01a551966..5443170d8b 100644
--- a/source3/rpc_client/cli_ds.c
+++ b/source3/rpc_client/cli_ds.c
@@ -98,10 +98,14 @@ NTSTATUS rpccli_ds_enum_domain_trusts(struct rpc_pipe_client *cli,
int i;
*num_domains = r.num_domains;
- *trusts = TALLOC_ARRAY(mem_ctx, struct ds_domain_trust, r.num_domains);
+ if (r.num_domains) {
+ *trusts = TALLOC_ARRAY(mem_ctx, struct ds_domain_trust, r.num_domains);
- if (*trusts == NULL) {
- return NT_STATUS_NO_MEMORY;
+ if (*trusts == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ } else {
+ *trusts = NULL;
}
for ( i=0; i< *num_domains; i++ ) {