diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-08-04 10:32:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:29:17 -0500 |
commit | 87165a81d9a9be0b3476c130cb772a8a578f4f94 (patch) | |
tree | e95b7549d4cc4f6a2b20b623a0271f72f1dadeb0 /source3 | |
parent | 8476d072d34ee8a9562aa99d628484926939ebdd (diff) | |
download | samba-87165a81d9a9be0b3476c130cb772a8a578f4f94.tar.gz samba-87165a81d9a9be0b3476c130cb772a8a578f4f94.tar.bz2 samba-87165a81d9a9be0b3476c130cb772a8a578f4f94.zip |
r24167: Fix Coverity ID 365
We checked argc>=3 some lines above
(This used to be commit fa385e9f3c980756e428d89e73012cce895c3bf6)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpcclient/cmd_samr.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c index b5ccab8886..d8528339fe 100644 --- a/source3/rpcclient/cmd_samr.c +++ b/source3/rpcclient/cmd_samr.c @@ -1798,18 +1798,15 @@ static NTSTATUS cmd_samr_lookup_names(struct rpc_pipe_client *cli, /* Look up names */ num_names = argc - 2; - if (num_names) { - if ((names = TALLOC_ARRAY(mem_ctx, const char *, num_names)) == NULL) { - rpccli_samr_close(cli, mem_ctx, &domain_pol); - rpccli_samr_close(cli, mem_ctx, &connect_pol); - result = NT_STATUS_NO_MEMORY; - goto done; - } - } else { - names = NULL; + + if ((names = TALLOC_ARRAY(mem_ctx, const char *, num_names)) == NULL) { + rpccli_samr_close(cli, mem_ctx, &domain_pol); + rpccli_samr_close(cli, mem_ctx, &connect_pol); + result = NT_STATUS_NO_MEMORY; + goto done; } - for (i = 0; i < argc - 2; i++) + for (i = 0; i < num_names; i++) names[i] = argv[i + 2]; result = rpccli_samr_lookup_names(cli, mem_ctx, &domain_pol, |