1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

s3:rpcclient: give errors and clean up correctly after failing to obtain secret

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Garming Sam 2013-11-29 14:45:20 +13:00 committed by Stefan Metzmacher
parent 5107ca02a4
commit a012e2fdd6

View File

@ -786,6 +786,9 @@ static NTSTATUS do_cmd(struct cli_state *cli,
account_name = talloc_asprintf(mem_ctx, "%s$", _account_name);
if (account_name == NULL) {
DEBUG(0, ("Out of memory creating account name to connect to %s.\n",
cmd_entry->table->name));
TALLOC_FREE(cmd_entry->rpc_pipe);
SAFE_FREE(previous_nt_hash);
TALLOC_FREE(mem_ctx);
return NT_STATUS_NO_MEMORY;
@ -799,6 +802,9 @@ static NTSTATUS do_cmd(struct cli_state *cli,
talloc_autofree_context(),
&rpcclient_netlogon_creds);
if (!NT_STATUS_IS_OK(ntresult)) {
DEBUG(0, ("Could not initialise credentials for %s.\n",
cmd_entry->table->name));
TALLOC_FREE(cmd_entry->rpc_pipe);
SAFE_FREE(previous_nt_hash);
TALLOC_FREE(mem_ctx);
return ntresult;