diff options
author | Günther Deschner <gd@samba.org> | 2008-04-03 00:23:50 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-04-04 09:38:33 +0200 |
commit | 2075ce26d4f6dcb70c125e87a10d752681aa6150 (patch) | |
tree | b00652220fe188196b04415b66d5741dd12d143c /source/rpc_client | |
parent | d79b519cab977df5ad78fe44b05b12da0af347f3 (diff) | |
download | samba-2075ce26d4f6dcb70c125e87a10d752681aa6150.tar.gz |
Fix rpccli_lsa_lookup_sids_noalloc.
When looking up e.g. a trusted doamin account, there is just no name.
Michael, please check.
Guenther
(cherry picked from commit ea3cfadc2504c891b4784719bd8e6debcc38c879)
Diffstat (limited to 'source/rpc_client')
-rw-r--r-- | source/rpc_client/cli_lsarpc.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c index 0b89488a21f..4a311b8c9ff 100644 --- a/source/rpc_client/cli_lsarpc.c +++ b/source/rpc_client/cli_lsarpc.c @@ -204,11 +204,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; |