From c19380a4ead3afbf70a9bf7e65ef607a7c4545ef Mon Sep 17 00:00:00 2001 From: Samuel Cabrero Date: Mon, 26 Jan 2026 13:36:02 +0100 Subject: [PATCH 1/3] s3:rpc_client: Fix memory leak opening local named pipe If no local server name was passed to rpc_pipe_open_local_np() then get_myname() was called with NULL talloc context instead of the current stackframe. This was causing an increase of memory usage on busy servers with long-living rpcd_* workers. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15979 Signed-off-by: Samuel Cabrero Reviewed-by: Noel Power Reviewed-by: Volker Lendecke Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Tue Jan 27 10:13:40 UTC 2026 on atb-devel-224 --- source3/rpc_client/cli_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index e3f48526492..c61b8eb16cf 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3625,7 +3625,7 @@ NTSTATUS rpc_pipe_open_local_np( } if (local_server_name == NULL) { - local_server_name = get_myname(result); + local_server_name = get_myname(frame); } if (local_server_addr != NULL) { -- 2.51.0 From 5a2998384b213ce3ecfdcc0563589487b410ef60 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 29 Jan 2026 11:00:26 +0000 Subject: [PATCH 2/3] s3/printing: Fix leaked mem ctx returned from talloc_new BUG: https://bugzilla.samba.org/show_bug.cgi?id=15979 Signed-off-by: Noel Power Reviewed-by: Gary Lockyer --- source3/printing/printing.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 48d221de127..74a8ab1a252 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -2836,7 +2836,7 @@ NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum, pjob->filename, pjob->size ? "deleted" : "zero length" )); unlink(pjob->filename); pjob_delete(global_event_context(), msg_ctx, sharename, jobid); - return NT_STATUS_OK; + goto out; } /* don't strip out characters like '$' from the printername */ @@ -2878,7 +2878,8 @@ NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum, /* make sure the database is up to date */ if (print_cache_expired(lp_const_servicename(snum), True)) print_queue_update(msg_ctx, snum, False); - +out: + talloc_free(tmp_ctx); return NT_STATUS_OK; fail: -- 2.51.0 From 0cfa22846403f47ea257158fe377bf502a6f9815 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 29 Jan 2026 15:12:52 +0000 Subject: [PATCH 3/3] s3/printing: Fix leaking parsed options BUG: https://bugzilla.samba.org/show_bug.cgi?id=15979 Signed-off-by: Noel Power Reviewed-by: Gary Lockyer Autobuild-User(master): Noel Power Autobuild-Date(master): Fri Jan 30 11:09:44 UTC 2026 on atb-devel-224 --- source3/printing/print_cups.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c index d8ba9ccd011..f1449e1d1ea 100644 --- a/source3/printing/print_cups.c +++ b/source3/printing/print_cups.c @@ -1130,6 +1130,9 @@ static int cups_job_submit(int snum, struct printjob *pjob, if (http) httpClose(http); + if (num_options) { + cupsFreeOptions(num_options, options); + } TALLOC_FREE(frame); return ret; -- 2.51.0