diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-08-21 07:43:29 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:58:14 -0500 |
commit | b7e1ea20dc873a753ff64653987130f03897a4e9 (patch) | |
tree | 67f37a1a19113c622dedf942f39b27ca994c1b05 /source4/libcli/cliconnect.c | |
parent | b45f4ebbb880e41abf86abb54264123f3edbde05 (diff) | |
download | samba-b7e1ea20dc873a753ff64653987130f03897a4e9.tar.gz samba-b7e1ea20dc873a753ff64653987130f03897a4e9.tar.bz2 samba-b7e1ea20dc873a753ff64653987130f03897a4e9.zip |
r1985: take advantage of the new talloc in a few more places
(This used to be commit 6ffdfd779936ce8c5ca49c5f444e8da2bbeee0a8)
Diffstat (limited to 'source4/libcli/cliconnect.c')
-rw-r--r-- | source4/libcli/cliconnect.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c index 14f7d5a1b3..d89925eda5 100644 --- a/source4/libcli/cliconnect.c +++ b/source4/libcli/cliconnect.c @@ -195,13 +195,11 @@ NTSTATUS smbcli_tdis(struct smbcli_state *cli) struct smbcli_state *smbcli_state_init(void) { struct smbcli_state *cli; - TALLOC_CTX *mem_ctx; - - mem_ctx = talloc_init("smbcli_state"); - if (!mem_ctx) return NULL; - cli = talloc_zero(mem_ctx, sizeof(*cli)); - cli->mem_ctx = mem_ctx; + cli = talloc_named(NULL, sizeof(*cli), "smbcli_state"); + if (cli) { + ZERO_STRUCTP(cli); + } return cli; } @@ -216,7 +214,5 @@ void smbcli_shutdown(struct smbcli_state *cli) cli->tree->reference_count++; smbcli_tree_close(cli->tree); } - if (cli->mem_ctx) { - talloc_destroy(cli->mem_ctx); - } + talloc_free(cli); } |