summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-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)));