summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-05-03 15:15:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:29 -0500
commit2b5a7a4e1eed3f8744dfe242ec17274f1c8df375 (patch)
treed5fff45860cecbdb2134c7a4810274880e2f9980
parent35a05d1dc0c551656d9caeea87a9925182d717bc (diff)
downloadsamba-2b5a7a4e1eed3f8744dfe242ec17274f1c8df375.tar.gz
samba-2b5a7a4e1eed3f8744dfe242ec17274f1c8df375.tar.bz2
samba-2b5a7a4e1eed3f8744dfe242ec17274f1c8df375.zip
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)
-rw-r--r--source4/rpc_server/dcerpc_sock.c10
1 files changed, 5 insertions, 5 deletions
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);