]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/job: add check for return of job_type_merge_and_collapse()
authorFilipe Brandenburger <filbranden@google.com>
Tue, 12 Jun 2018 21:20:04 +0000 (14:20 -0700)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Jun 2018 11:16:38 +0000 (13:16 +0200)
Using an assertion is fine, since calls to job_merge_into_installed()
are protected by a check for job_type_is_conflicting().

Uncovered by Coverity, fixes CID 996307.

src/core/job.c

index 734756b6665e986ca3130e2848f9ee69a0945b91..2f37ff5bacb0c224772f8ad636e5b68c2232a9fc 100644 (file)
@@ -174,7 +174,7 @@ static void job_merge_into_installed(Job *j, Job *other) {
         assert(j->unit == other->unit);
 
         if (j->type != JOB_NOP)
-                job_type_merge_and_collapse(&j->type, other->type, j->unit);
+                assert_se(job_type_merge_and_collapse(&j->type, other->type, j->unit) == 0);
         else
                 assert(other->type == JOB_NOP);