From a012e2fdd6733e871ddeb68874a2df8413ad91ed Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Fri, 29 Nov 2013 14:45:20 +1300 Subject: s3:rpcclient: give errors and clean up correctly after failing to obtain secret Signed-off-by: Garming Sam Reviewed-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source3/rpcclient/rpcclient.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3') diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c index fa683b57d2..ed2abc7c4f 100644 --- a/source3/rpcclient/rpcclient.c +++ b/source3/rpcclient/rpcclient.c @@ -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; -- cgit