diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-07-31 09:44:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-07-31 09:45:03 +0200 |
commit | 735a8b6d38a7116975a4650b0967ad71a4757559 (patch) | |
tree | 944dbcd7ddd70788df79a63a3c5a99b7ac63f12d | |
parent | 38c569bbb810dcbdf746c96ba6077acb56ca65bd (diff) | |
download | systemd-735a8b6d38a7116975a4650b0967ad71a4757559.tar.gz systemd-735a8b6d38a7116975a4650b0967ad71a4757559.tar.bz2 systemd-735a8b6d38a7116975a4650b0967ad71a4757559.zip |
job: fix coverity issue
Fixes coverity issue 1403550
-rw-r--r-- | src/core/job.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/job.c b/src/core/job.c index cda4f344b8..9537366eb9 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -1153,8 +1153,11 @@ void job_add_to_run_queue(Job *j) { log_warning_errno(r, "Failed to enable job run queue event source, ignoring: %m"); } - prioq_put(j->manager->run_queue, j, &j->run_queue_idx); - j->in_run_queue = true; + r = prioq_put(j->manager->run_queue, j, &j->run_queue_idx); + if (r < 0) + log_warning_errno(r, "Failed put job in run queue, ignoring: %m"); + else + j->in_run_queue = true; } void job_add_to_dbus_queue(Job *j) { |