s3: rpcclient: Use rpcclient_msg_ctx as the long-lived talloc context for rpcclient_n...
authorJeremy Allison <jra@samba.org>
Mon, 24 Jul 2017 20:14:08 +0000 (13:14 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 26 Jul 2017 19:35:22 +0000 (21:35 +0200)
Guaranteed to stay around until the command exits.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12932

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpcclient/rpcclient.c

index 96c7410868aaafd1d1f676ad87adf0b462d6a9e1..0f3dcc6cb1a3098cf9493fe0025403e33625a1f8 100644 (file)
@@ -766,7 +766,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
                                default_transport,
                                rpcclient_netlogon_domain,
                                &cmd_entry->rpc_pipe,
-                               talloc_autofree_context(),
+                               rpcclient_msg_ctx,
                                &rpcclient_netlogon_creds);
                        break;
                default:
@@ -805,7 +805,7 @@ static NTSTATUS do_cmd(struct cli_state *cli,
                        ntresult = rpccli_create_netlogon_creds_with_creds(creds,
                                                        dc_name,
                                                        rpcclient_msg_ctx,
-                                                       talloc_autofree_context(),
+                                                       rpcclient_msg_ctx,
                                                        &rpcclient_netlogon_creds);
                        if (!NT_STATUS_IS_OK(ntresult)) {
                                DEBUG(0, ("Could not initialise credentials for %s.\n",