summaryrefslogtreecommitdiff
path: root/source4/libcli/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-12-01 00:22:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:46:54 -0500
commitf5d4623ea5a755a9525b9ef4532420ee53729a3d (patch)
tree80a780e1495c28991712363e3cebf6f934d0e80c /source4/libcli/raw
parent7d960dfc39969860ed0fba5883417591377f5539 (diff)
downloadsamba-f5d4623ea5a755a9525b9ef4532420ee53729a3d.tar.gz
samba-f5d4623ea5a755a9525b9ef4532420ee53729a3d.tar.bz2
samba-f5d4623ea5a755a9525b9ef4532420ee53729a3d.zip
r11982: ensure the fde event gets freed before the socket itself, as otherwise
we get a error from epoll about disabling events for a file descriptor that is closed (This used to be commit f32739307464a1f0c835cff886b8c4b960778900)
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r--source4/libcli/raw/clisocket.c8
-rw-r--r--source4/libcli/raw/clitransport.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index be25b36007..40d9d2784a 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -179,10 +179,10 @@ NTSTATUS smbcli_sock_connect(TALLOC_CTX *mem_ctx,
****************************************************************************/
void smbcli_sock_dead(struct smbcli_socket *sock)
{
- if (sock->sock != NULL) {
- talloc_free(sock->sock);
- sock->sock = NULL;
- }
+ talloc_free(sock->event.fde);
+ sock->event.fde = NULL;
+ talloc_free(sock->sock);
+ sock->sock = NULL;
}
/****************************************************************************
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 1cd0a3046e..a0efe7042c 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -115,7 +115,7 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
handles events up until we are connected */
talloc_free(transport->socket->event.fde);
transport->socket->event.fde = event_add_fd(transport->socket->event.ctx,
- transport->socket,
+ transport->socket->sock,
socket_get_fd(transport->socket->sock),
EVENT_FD_READ,
smbcli_transport_event_handler,