diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-12-10 19:38:38 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-12-12 11:15:07 +0100 |
commit | 48235ad6b7ef168e029d48701a08b62b616bcdd2 (patch) | |
tree | f5d276d5c639b1ae14cc47fc2e4d4c76fb37d90f /src/core/job.c | |
parent | core: don't track jobs-finishing-during-reload explicitly (diff) | |
download | systemd-48235ad6b7ef168e029d48701a08b62b616bcdd2.tar.xz systemd-48235ad6b7ef168e029d48701a08b62b616bcdd2.zip |
job: be more careful when removing job object from jobs hash table
Let's validate that the ID is actually allocated to us before remove a
job.
This is relevant as various bits of code will call job_free() on
partially set up Job objects, and we really shouldn't remove another job
object accidentally from the hash table, when the set up didn't
complete.
Diffstat (limited to '')
-rw-r--r-- | src/core/job.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/job.c b/src/core/job.c index 7fa3673474..8106a78e66 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -151,7 +151,7 @@ void job_uninstall(Job *j) { unit_add_to_gc_queue(j->unit); - hashmap_remove(j->manager->jobs, UINT32_TO_PTR(j->id)); + hashmap_remove_value(j->manager->jobs, UINT32_TO_PTR(j->id), j); j->installed = false; } |