diff options
author | Ralph Boehme <slow@samba.org> | 2021-03-23 11:40:21 +0100 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2021-03-31 11:11:31 +0000 |
commit | 4c3fb2a5912966a61e7ebdb05eb3231a0e1d6033 (patch) | |
tree | 3e59df526c579064bd3f7b086dd4b75ea5593638 /source3 | |
parent | 10d753868e810604d8f60673bbd48f55aaff0797 (diff) | |
download | samba-4c3fb2a5912966a61e7ebdb05eb3231a0e1d6033.tar.gz |
pidl: set the per-request memory context in the pidl generator
The talloc memory context referenced by the pipe_struct mem_ctx member is used
as talloc parent for RPC response data by the RPC service implementations.
In Samba versions up to 4.10 all talloc children of p->mem_ctx were freed after
a RPC response was delivered by calling talloc_free_children(p->mem_ctx). Commit
60fa8e255254d38e9443bf96f2c0f31430be6ab8 removed this call which resulted in all
memory allocations on this context not getting released, which can consume
significant memory in long running RPC connections.
Instead of putting the talloc_free_children(p->mem_ctx) back, just use the
mem_ctx argument of the ${pipename}_op_dispatch_internal() function which is a
dcesrv_call_state object created by dcesrv_process_ncacn_packet() and released
by the RPC server when the RPC request processing is finished.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14675
CI: https://gitlab.com/samba-team/samba/-/merge_requests/1861
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpc_server/rpc_handles.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/source3/rpc_server/rpc_handles.c b/source3/rpc_server/rpc_handles.c index 45968746440..9ef93231466 100644 --- a/source3/rpc_server/rpc_handles.c +++ b/source3/rpc_server/rpc_handles.c @@ -60,12 +60,6 @@ int make_base_pipes_struct(TALLOC_CTX *mem_ctx, return ENOMEM; } - p->mem_ctx = talloc_named(p, 0, "pipe %s %p", pipe_name, p); - if (!p->mem_ctx) { - talloc_free(p); - return ENOMEM; - } - p->msg_ctx = msg_ctx; p->transport = transport; |