From: Noel Power Date: Thu, 29 Jan 2026 11:00:26 +0000 (+0000) Subject: s3/printing: Fix leaked mem ctx returned from talloc_new X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ba76344ef807577ea1fd4265d585285eb633971;p=thirdparty%2Fsamba.git 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 --- diff --git a/source3/printing/printing.c b/source3/printing/printing.c index bcfd893456b..3afc3733983 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -2900,7 +2900,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 */ @@ -2942,7 +2942,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: