summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-26 07:04:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:17 -0500
commit954869efdb8b0006fd4457a1c6d56a31c3825421 (patch)
tree7b2b7d01997549697e334a77e12a8fa7cd57819c /source4/libcli
parent3ea916b2278c202c99c80c02e80e588bd7daedb8 (diff)
downloadsamba-954869efdb8b0006fd4457a1c6d56a31c3825421.tar.gz
samba-954869efdb8b0006fd4457a1c6d56a31c3825421.tar.bz2
samba-954869efdb8b0006fd4457a1c6d56a31c3825421.zip
r2655: fixed an error in the shutdown of the sock->transport->session->tree
smbcli raw context handling (This used to be commit d5fd6388751944f11c34e5124d403d57c8670e3b)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/raw/clisession.c1
-rw-r--r--source4/libcli/raw/clisocket.c1
-rw-r--r--source4/libcli/raw/clitransport.c3
-rw-r--r--source4/libcli/raw/clitree.c3
4 files changed, 4 insertions, 4 deletions
diff --git a/source4/libcli/raw/clisession.c b/source4/libcli/raw/clisession.c
index 75b9645018..516da2fa2e 100644
--- a/source4/libcli/raw/clisession.c
+++ b/source4/libcli/raw/clisession.c
@@ -55,7 +55,6 @@ void smbcli_session_close(struct smbcli_session *session)
session->reference_count--;
if (session->reference_count <= 0) {
smbcli_transport_close(session->transport);
- talloc_free(session);
}
}
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index 5663672333..8481bc73e2 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -104,6 +104,7 @@ void smbcli_sock_close(struct smbcli_socket *sock)
sock->reference_count--;
if (sock->reference_count <= 0) {
smbcli_sock_dead(sock);
+ talloc_free(sock);
}
}
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index c0d84179d6..d70ceceab3 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -90,11 +90,10 @@ void smbcli_transport_close(struct smbcli_transport *transport)
{
transport->reference_count--;
if (transport->reference_count <= 0) {
- smbcli_sock_close(transport->socket);
event_remove_fd(transport->event.ctx, transport->event.fde);
event_remove_timed(transport->event.ctx, transport->event.te);
event_context_destroy(transport->event.ctx);
- talloc_free(transport);
+ smbcli_sock_close(transport->socket);
}
}
diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c
index c383eef768..e3a1a6d341 100644
--- a/source4/libcli/raw/clitree.c
+++ b/source4/libcli/raw/clitree.c
@@ -55,7 +55,6 @@ void smbcli_tree_close(struct smbcli_tree *tree)
tree->reference_count--;
if (tree->reference_count <= 0) {
smbcli_session_close(tree->session);
- talloc_free(tree);
}
}
@@ -193,6 +192,8 @@ NTSTATUS smbcli_tree_full_connection(struct smbcli_tree **ret_tree,
return NT_STATUS_NO_MEMORY;
}
+ talloc_set_name_const(sock, "smbcli_tree_full_connection");
+
/* open a TCP socket to the server */
if (!smbcli_sock_connect_byname(sock, dest_host, port)) {
DEBUG(2,("Failed to establish socket connection - %s\n", strerror(errno)));