summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_netlogon.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_client/cli_netlogon.c')
-rw-r--r--source3/rpc_client/cli_netlogon.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/source3/rpc_client/cli_netlogon.c b/source3/rpc_client/cli_netlogon.c
index cb1d93e9c1..7beaae2e22 100644
--- a/source3/rpc_client/cli_netlogon.c
+++ b/source3/rpc_client/cli_netlogon.c
@@ -136,13 +136,12 @@ NTSTATUS rpccli_netlogon_setup_creds(struct rpc_pipe_client *cli,
SMB_ASSERT(rpccli_is_pipe_idx(cli, PI_NETLOGON));
- dc = cli->dc;
- if (!dc) {
- return NT_STATUS_INVALID_PARAMETER;
+ TALLOC_FREE(cli->dc);
+ cli->dc = talloc_zero(cli, struct dcinfo);
+ if (cli->dc == NULL) {
+ return NT_STATUS_NO_MEMORY;
}
-
- /* Ensure we don't reuse any of this state. */
- ZERO_STRUCTP(dc);
+ dc = cli->dc;
/* Store the machine account password we're going to use. */
memcpy(dc->mach_pw, machine_pwd, 16);