summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/nbt/nbtsocket.c7
-rw-r--r--source4/libcli/raw/clisocket.c3
-rw-r--r--source4/libcli/raw/clitransport.c4
-rw-r--r--source4/libcli/resolve/host.c3
4 files changed, 6 insertions, 11 deletions
diff --git a/source4/libcli/nbt/nbtsocket.c b/source4/libcli/nbt/nbtsocket.c
index d970f8e4e0..1eea77d356 100644
--- a/source4/libcli/nbt/nbtsocket.c
+++ b/source4/libcli/nbt/nbtsocket.c
@@ -266,9 +266,7 @@ struct nbt_name_socket *nbt_name_socket_init(TALLOC_CTX *mem_ctx,
fde.flags = 0;
fde.handler = nbt_name_socket_handler;
fde.private = nbtsock;
- nbtsock->fde = event_add_fd(nbtsock->event_ctx, &fde);
-
- talloc_steal(nbtsock, nbtsock->fde);
+ nbtsock->fde = event_add_fd(nbtsock->event_ctx, &fde, nbtsock);
return nbtsock;
@@ -344,8 +342,7 @@ struct nbt_name_request *nbt_name_request_send(struct nbt_name_socket *nbtsock,
te.next_event = timeout;
te.handler = nbt_name_socket_timeout;
te.private = req;
- req->te = event_add_timed(nbtsock->event_ctx, &te);
- talloc_steal(req, req->te);
+ req->te = event_add_timed(nbtsock->event_ctx, &te, req);
talloc_set_destructor(req, nbt_name_request_destructor);
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index 847f5c1b0a..c9934fa16d 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -138,8 +138,7 @@ static NTSTATUS smbcli_sock_connect_one(struct smbcli_socket *sock,
fde.handler = smbcli_sock_connect_handler;
fde.private = sock;
- sock->event.fde = event_add_fd(sock->event.ctx, &fde);
- talloc_steal(sock, sock->event.fde);
+ sock->event.fde = event_add_fd(sock->event.ctx, &fde, sock);
sock->port = port;
set_blocking(fde.fd, False);
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index b053b362ca..e3a8281f3f 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -321,8 +321,8 @@ void smbcli_transport_idle_handler(struct smbcli_transport *transport,
te.next_event = timeval_current_ofs(0, period);
te.handler = idle_handler;
te.private = transport;
- transport->socket->event.te = event_add_timed(transport->socket->event.ctx, &te);
- talloc_steal(transport, transport->socket->event.te);
+ transport->socket->event.te = event_add_timed(transport->socket->event.ctx,
+ &te, transport);
}
/*
diff --git a/source4/libcli/resolve/host.c b/source4/libcli/resolve/host.c
index b9aa1aa272..5b28a850fc 100644
--- a/source4/libcli/resolve/host.c
+++ b/source4/libcli/resolve/host.c
@@ -165,13 +165,12 @@ struct smbcli_composite *resolve_name_host_send(struct nbt_name *name,
fde.flags = EVENT_FD_READ;
fde.handler = pipe_handler;
fde.private = c;
- state->fde = event_add_fd(c->event_ctx, &fde);
+ state->fde = event_add_fd(c->event_ctx, &fde, state);
if (state->fde == NULL) {
close(fd[0]);
close(fd[1]);
goto failed;
}
- talloc_steal(state, state->fde);
/* signal handling in posix really sucks - doing this in a library
affects the whole app, but what else to do?? */