]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/printing: Fix leaked mem ctx returned from talloc_new
authorNoel Power <noel.power@suse.com>
Thu, 29 Jan 2026 11:00:26 +0000 (11:00 +0000)
committerNoel Power <npower@samba.org>
Fri, 30 Jan 2026 10:05:39 +0000 (10:05 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15979
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source3/printing/printing.c

index bcfd893456b23d7969830ab0e10aec6058068478..3afc373398353299db039fbb0f336b8166917ba9 100644 (file)
@@ -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: