From 655b710204e7a7d8e486da7ba675fcbeed116fea Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 16 Sep 2006 16:59:37 +0000 Subject: r18584: found one of the fd leaks. The registry backend was using a talloc(NULL, xxx) to allocate the registry context. That had two consequences 1) it was a massive memory leak, as all winreg operations leaked their entire context (including an open ldb database) every time 2) event_context_find() never found the exsting event context, so we used a new event context each time, which called epoll_create() each time, which caused a fd to be allocated (This used to be commit 1c0a3de39828b43149d8981fc7f10e7c8b59a392) --- source4/lib/registry/reg_samba.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source4/lib/registry/reg_samba.c') diff --git a/source4/lib/registry/reg_samba.c b/source4/lib/registry/reg_samba.c index 4a88d96042..3553c4cb6d 100644 --- a/source4/lib/registry/reg_samba.c +++ b/source4/lib/registry/reg_samba.c @@ -68,9 +68,12 @@ static WERROR reg_samba_get_predef (struct registry_context *ctx, uint32_t hkey, return error; } -_PUBLIC_ WERROR reg_open_local (struct registry_context **ctx, struct auth_session_info *session_info, struct cli_credentials *credentials) +_PUBLIC_ WERROR reg_open_local (TALLOC_CTX *mem_ctx, + struct registry_context **ctx, + struct auth_session_info *session_info, + struct cli_credentials *credentials) { - *ctx = talloc(NULL, struct registry_context); + *ctx = talloc(mem_ctx, struct registry_context); (*ctx)->credentials = talloc_reference(*ctx, credentials); (*ctx)->session_info = talloc_reference(*ctx, session_info); (*ctx)->get_predefined_key = reg_samba_get_predef; -- cgit