summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_client/cli_lsarpc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_lsarpc.c b/source3/rpc_client/cli_lsarpc.c
index 3d57e22f42..37387a04dd 100644
--- a/source3/rpc_client/cli_lsarpc.c
+++ b/source3/rpc_client/cli_lsarpc.c
@@ -203,11 +203,19 @@ static NTSTATUS rpccli_lsa_lookup_sids_noalloc(struct rpc_pipe_client *cli,
dom_name = ref_domains->domains[dom_idx].name.string;
name = lsa_names.names[i].name.string;
- (names)[i] = talloc_strdup(mem_ctx, name);
+ if (name) {
+ (names)[i] = talloc_strdup(mem_ctx, name);
+ if ((names)[i] == NULL) {
+ DEBUG(0, ("cli_lsa_lookup_sids_noalloc(): out of memory\n"));
+ result = NT_STATUS_UNSUCCESSFUL;
+ goto done;
+ }
+ } else {
+ (names)[i] = NULL;
+ }
(domains)[i] = talloc_strdup(mem_ctx, dom_name);
(types)[i] = lsa_names.names[i].sid_type;
-
- if (((names)[i] == NULL) || ((domains)[i] == NULL)) {
+ if (((domains)[i] == NULL)) {
DEBUG(0, ("cli_lsa_lookup_sids_noalloc(): out of memory\n"));
result = NT_STATUS_UNSUCCESSFUL;
goto done;