summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-03-09 10:38:00 +0100
committerSimo Sorce <idra@samba.org>2011-03-23 17:19:22 +0100
commitb2bdc20f65f0d5fda5b9fdb9dc6222e2f219bbea (patch)
treee11e8ef5b744fb7ad25acfef4f094f4be3c68acf /source3
parent81a2046879299a051e69fd4d78b3a8e49b690f1b (diff)
downloadsamba-b2bdc20f65f0d5fda5b9fdb9dc6222e2f219bbea.tar.gz
samba-b2bdc20f65f0d5fda5b9fdb9dc6222e2f219bbea.tar.bz2
samba-b2bdc20f65f0d5fda5b9fdb9dc6222e2f219bbea.zip
s3-rpc_server: Added a memory context to the ep regsiter state.
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/rpc_ep_setup.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/source3/rpc_server/rpc_ep_setup.c b/source3/rpc_server/rpc_ep_setup.c
index 6ffcf10b9b..ddc655cb67 100644
--- a/source3/rpc_server/rpc_ep_setup.c
+++ b/source3/rpc_server/rpc_ep_setup.c
@@ -160,6 +160,7 @@ static NTSTATUS rpc_ep_setup_try_register(TALLOC_CTX *mem_ctx,
struct rpc_ep_regsiter_state {
struct dcerpc_binding_handle *h;
+ TALLOC_CTX *mem_ctx;
struct tevent_context *ev_ctx;
struct messaging_context *msg_ctx;
@@ -185,6 +186,15 @@ static NTSTATUS rpc_ep_setup_register(struct tevent_context *ev_ctx,
return NT_STATUS_NO_MEMORY;
}
+ state->mem_ctx = talloc_named(state,
+ 0,
+ "ep %s %p",
+ iface->name, state);
+ if (state->mem_ctx == NULL) {
+ talloc_free(state);
+ return NT_STATUS_NO_MEMORY;
+ }
+
state->wait_time = 1;
state->ev_ctx = ev_ctx;
state->msg_ctx = msg_ctx;
@@ -192,8 +202,10 @@ static NTSTATUS rpc_ep_setup_register(struct tevent_context *ev_ctx,
state->ncalrpc = talloc_strdup(state, ncalrpc);
state->port = port;
- req = tevent_wakeup_send(state, ev_ctx, timeval_current_ofs(1, 0));
- if (tevent_req_nomem(state, req)) {
+ req = tevent_wakeup_send(state->mem_ctx,
+ state->ev_ctx,
+ timeval_current_ofs(1, 0));
+ if (tevent_req_nomem(state->mem_ctx, req)) {
talloc_free(state);
return NT_STATUS_NO_MEMORY;
}
@@ -217,7 +229,7 @@ static void rpc_ep_setup_register_loop(struct tevent_req *req)
return;
}
- status = rpc_ep_setup_try_register(state,
+ status = rpc_ep_setup_try_register(state->mem_ctx,
state->ev_ctx,
state->msg_ctx,
state->iface,
@@ -235,10 +247,10 @@ static void rpc_ep_setup_register_loop(struct tevent_req *req)
return;
}
- req = tevent_wakeup_send(state,
+ req = tevent_wakeup_send(state->mem_ctx,
state->ev_ctx,
timeval_current_ofs(state->wait_time, 0));
- if (tevent_req_nomem(state, req)) {
+ if (tevent_req_nomem(state->mem_ctx, req)) {
talloc_free(state);
return;
}