mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
r24167: Fix Coverity ID 365
We checked argc>=3 some lines above
(This used to be commit fa385e9f3c
)
This commit is contained in:
parent
8476d072d3
commit
87165a81d9
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user