From 6c14b0133dede38294a812be7f5f5bd5ec3d498b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 23 Jan 2005 12:17:45 +0000 Subject: r4944: every event_add_*() caller was having to call talloc_steal() to take control of the event, so instead build that into the function. If you pass NULL as mem_ctx then it leaves it as a child of the events structure. (This used to be commit 7f981b9ed96f39027cbfd500f41e0c2be64cbb50) --- source4/libcli/raw/clisocket.c | 3 +-- source4/libcli/raw/clitransport.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'source4/libcli/raw') 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); } /* -- cgit