]> git.ipfire.org Git - thirdparty/cups.git/commit
scheduler/job.c: unload job before freeing job history in cupsdDeletejob()
authorzdohnal <zdohnal@redhat.com>
Mon, 30 Oct 2023 10:29:52 +0000 (11:29 +0100)
committerGitHub <noreply@github.com>
Mon, 30 Oct 2023 10:29:52 +0000 (11:29 +0100)
commite6fcc26e8e96ea0b790029530a769a715a1ed787
tree7d762ea3acb8fec256b963a1ebddcfc9037419aa
parent082c5ae12a72889312452716efed3cf8833e3518
parent7781cc73cd69cc6c3eba526ac4851d9604e68d43
scheduler/job.c: unload job before freeing job history in cupsdDeletejob()

With "PreserveJobHistory Off", LogLevel not set to debug (or debug2), and "LogDebugHistory 200" (the default), cupsdDeleteJob() frees the job history and then unloads the job. However, unload_job() calls cupsdLogJob() which re-creates the job history and puts "Unloading..." into it because level (debug) is greater than LogLevel (warn) and LogDebugHistory is set to 200 messages by default. Unused (and unreachable) job history is left behind, resulting in a memory leak.

The solution seems to be to unload the job before freeing the job history.