s3: rpcclient: Use event context as the talloc parent of the rpcclient_msg_ctx.
authorJeremy Allison <jra@samba.org>
Mon, 24 Jul 2017 20:12:20 +0000 (13:12 -0700)
committerJeremy Allison <jra@samba.org>
Wed, 26 Jul 2017 19:35:22 +0000 (21:35 +0200)
Give control over shutdown.

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 835b288ee20f47923e586b07994f2a4531cc2ac6..96c7410868aaafd1d1f676ad87adf0b462d6a9e1 100644 (file)
@@ -1021,7 +1021,7 @@ out_free:
                goto done;
        }
 
-       nt_status = messaging_init_client(talloc_autofree_context(),
+       nt_status = messaging_init_client(ev_ctx,
                                          ev_ctx,
                                          &rpcclient_msg_ctx);
        if (geteuid() != 0 &&
@@ -1254,6 +1254,7 @@ done:
                cli_shutdown(cli);
        }
        popt_free_cmdline_auth_info();
+       TALLOC_FREE(rpcclient_msg_ctx);
        TALLOC_FREE(ev_ctx);
        TALLOC_FREE(frame);
        return result;