From d929f32dbe577b2bd389497433fb0a05c109a04b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 26 Jul 2005 07:23:57 +0000 Subject: r8777: make sure that the tree connect is a child of the return cli state structure. This fixes the BASE-DISCONNECT test (This used to be commit 86fe5817b1abc754763eede64b615dc8c9db5362) --- source4/libcli/cliconnect.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c index 489aea82dd..624b54c3f2 100644 --- a/source4/libcli/cliconnect.c +++ b/source4/libcli/cliconnect.c @@ -154,6 +154,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx, (*ret_cli)->tree = tree; (*ret_cli)->session = tree->session; (*ret_cli)->transport = tree->session->transport; + + talloc_steal(*ret_cli, tree); done: return status; @@ -173,14 +175,7 @@ NTSTATUS smbcli_tdis(struct smbcli_state *cli) ****************************************************************************/ struct smbcli_state *smbcli_state_init(TALLOC_CTX *mem_ctx) { - struct smbcli_state *cli; - - cli = talloc_zero(mem_ctx, struct smbcli_state); - if (cli) { - ZERO_STRUCTP(cli); - } - - return cli; + return talloc_zero(mem_ctx, struct smbcli_state); } /* -- cgit