job: fix coverity issue
authorLennart Poettering <lennart@poettering.net>
Wed, 31 Jul 2019 07:44:28 +0000 (09:44 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 31 Jul 2019 07:45:03 +0000 (09:45 +0200)
Fixes coverity issue 1403550

src/core/job.c

index cda4f34..9537366 100644 (file)
@@ -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) {