1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-11 00:23:51 +03:00

r1985: take advantage of the new talloc in a few more places

This commit is contained in:
Andrew Tridgell
2004-08-21 07:43:29 +00:00
committed by Gerald (Jerry) Carter
parent 03c341aca7
commit 6ffdfd7799
14 changed files with 148 additions and 155 deletions

View File

@@ -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);
}