diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-09-26 11:30:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:18 -0500 |
commit | e3880fa759cfa03222262327854fe7bbe585fe01 (patch) | |
tree | 7000172fad1b5cdcc0d071698ee3e203e61a8f4f /source4/libcli/cliconnect.c | |
parent | ad053090b817105a0974f4b8bf0b90e002297903 (diff) | |
download | samba-e3880fa759cfa03222262327854fe7bbe585fe01.tar.gz samba-e3880fa759cfa03222262327854fe7bbe585fe01.tar.bz2 samba-e3880fa759cfa03222262327854fe7bbe585fe01.zip |
r2660: - converted the libcli/raw/ library to use talloc_increase_ref_count()
rather than manual reference counts
- properly support SMBexit in the cifs and posix backends
- added a logoff method to all backends
With these changes the RAW-CONTEXT test now passes against the posix backend
(This used to be commit c315d6ac1cc40546fde1474702a6d66d07ee13c8)
Diffstat (limited to 'source4/libcli/cliconnect.c')
-rw-r--r-- | source4/libcli/cliconnect.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c index 27caaa9df9..f772070305 100644 --- a/source4/libcli/cliconnect.c +++ b/source4/libcli/cliconnect.c @@ -31,13 +31,13 @@ BOOL smbcli_socket_connect(struct smbcli_state *cli, const char *server) if (!sock) return False; if (!smbcli_sock_connect_byname(sock, server, 0)) { - smbcli_sock_close(sock); + talloc_free(sock); return False; } cli->transport = smbcli_transport_init(sock); if (!cli->transport) { - smbcli_sock_close(sock); + talloc_free(sock); return False; } @@ -112,8 +112,6 @@ NTSTATUS smbcli_send_tconX(struct smbcli_state *cli, const char *sharename, cli->tree = smbcli_tree_init(cli->session); if (!cli->tree) return NT_STATUS_UNSUCCESSFUL; - cli->tree->reference_count++; - mem_ctx = talloc_init("tcon"); if (!mem_ctx) { return NT_STATUS_NO_MEMORY; @@ -188,7 +186,6 @@ NTSTATUS smbcli_full_connection(struct smbcli_state **ret_cli, (*ret_cli)->tree = tree; (*ret_cli)->session = tree->session; (*ret_cli)->transport = tree->session->transport; - tree->reference_count++; done: talloc_free(mem_ctx); @@ -225,9 +222,6 @@ struct smbcli_state *smbcli_state_init(void) void smbcli_shutdown(struct smbcli_state *cli) { if (!cli) return; - if (cli->tree) { - cli->tree->reference_count++; - smbcli_tree_close(cli->tree); - } + talloc_free(cli->tree); talloc_free(cli); } |