From 2b5a7a4e1eed3f8744dfe242ec17274f1c8df375 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 3 May 2005 15:15:34 +0000 Subject: r6604: solved a memory hierarchy ordering problem that led to crashes on ncacn_ip_tcp and ncalrpc for the standard process model. Thanks to Jelmer for noticing this bug! (This used to be commit 81863cdd8bba0d4e39a1b4dc7e6dd7e6cafb38cf) --- source4/rpc_server/dcerpc_sock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4') diff --git a/source4/rpc_server/dcerpc_sock.c b/source4/rpc_server/dcerpc_sock.c index 56b55a9fbf..d4d862140a 100644 --- a/source4/rpc_server/dcerpc_sock.c +++ b/source4/rpc_server/dcerpc_sock.c @@ -151,7 +151,7 @@ static NTSTATUS add_socket_rpc_unix(struct dcesrv_context *dce_ctx, struct dcesr uint16_t port = 1; NTSTATUS status; - dcesrv_sock = talloc(dce_ctx, struct dcesrv_socket_context); + dcesrv_sock = talloc(event_ctx, struct dcesrv_socket_context); NT_STATUS_HAVE_NO_MEMORY(dcesrv_sock); /* remember the endpoint of this socket */ @@ -186,12 +186,12 @@ static NTSTATUS add_socket_rpc_ncalrpc(struct dcesrv_context *dce_ctx, struct dc full_path = talloc_asprintf(dce_ctx, "%s/%s", lp_ncalrpc_dir(), e->ep_description->endpoint); - dcesrv_sock = talloc(dce_ctx, struct dcesrv_socket_context); + dcesrv_sock = talloc(event_ctx, struct dcesrv_socket_context); NT_STATUS_HAVE_NO_MEMORY(dcesrv_sock); /* remember the endpoint of this socket */ dcesrv_sock->endpoint = e; - dcesrv_sock->dcesrv_ctx = dce_ctx; + dcesrv_sock->dcesrv_ctx = talloc_reference(dcesrv_sock, dce_ctx); status = stream_setup_socket(event_ctx, model_ops, &dcesrv_stream_ops, "unix", full_path, &port, dcesrv_sock); @@ -217,12 +217,12 @@ static NTSTATUS add_socket_rpc_tcp_iface(struct dcesrv_context *dce_ctx, struct port = atoi(e->ep_description->endpoint); } - dcesrv_sock = talloc(dce_ctx, struct dcesrv_socket_context); + dcesrv_sock = talloc(event_ctx, struct dcesrv_socket_context); NT_STATUS_HAVE_NO_MEMORY(dcesrv_sock); /* remember the endpoint of this socket */ dcesrv_sock->endpoint = e; - dcesrv_sock->dcesrv_ctx = dce_ctx; + dcesrv_sock->dcesrv_ctx = talloc_reference(dcesrv_sock, dce_ctx); status = stream_setup_socket(event_ctx, model_ops, &dcesrv_stream_ops, "ipv4", address, &port, dcesrv_sock); -- cgit