diff options
Diffstat (limited to 'source4/smbd')
-rw-r--r-- | source4/smbd/service.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/source4/smbd/service.c b/source4/smbd/service.c index 40a2a4b506..7067a26e7a 100644 --- a/source4/smbd/service.c +++ b/source4/smbd/service.c @@ -171,6 +171,7 @@ struct server_stream_socket *service_setup_stream_socket(struct server_service * } talloc_steal(stream_socket, sock); + talloc_steal(stream_socket, stream_socket->event.fde); if (stream_socket->stream.ops->socket_init) { stream_socket->stream.ops->socket_init(stream_socket); @@ -194,15 +195,6 @@ static int server_connection_destructor(void *ptr) conn->stream_socket->stream.ops->close_connection(conn, "shutdown"); } - if (conn->event.fde) { - event_remove_fd(conn->event.ctx, conn->event.fde); - conn->event.fde = NULL; - } - if (conn->event.idle) { - event_remove_timed(conn->event.ctx, conn->event.idle); - conn->event.idle = NULL; - } - return 0; } @@ -250,6 +242,9 @@ struct server_connection *server_setup_connection(struct event_context *ev, srv_conn->event.fde = event_add_fd(ev,&fde); srv_conn->event.idle = event_add_timed(ev,&idle); + talloc_steal(srv_conn, srv_conn->event.fde); + talloc_steal(srv_conn, srv_conn->event.idle); + talloc_set_destructor(srv_conn, server_connection_destructor); if (!socket_check_access(sock, "smbd", lp_hostsallow(-1), lp_hostsdeny(-1))) { |