From: Michael R Sweet Date: Wed, 22 May 2024 20:48:31 +0000 (-0400) Subject: More Coverity fixes. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db5fcc02083cdd77fb1764c0d7753df8fdba5d4a;p=thirdparty%2Fcups.git More Coverity fixes. --- diff --git a/backend/dnssd.c b/backend/dnssd.c index f8d6a58498..006becbdbe 100644 --- a/backend/dnssd.c +++ b/backend/dnssd.c @@ -224,11 +224,14 @@ main(int argc, // I - Number of command-line args bool done = sent == cupsArrayGetCount(Devices) && (time(NULL) - start) > 5; - cupsMutexUnlock(&DevicesMutex); - if (done) + { + cupsMutexUnlock(&DevicesMutex); break; + } } + + cupsMutexUnlock(&DevicesMutex); } return (CUPS_BACKEND_OK); diff --git a/backend/ipp.c b/backend/ipp.c index 17966f7f31..3b861be029 100644 --- a/backend/ipp.c +++ b/backend/ipp.c @@ -3583,12 +3583,12 @@ update_reasons(ipp_attribute_t *attr, /* I - printer-state-reasons or NULL */ remprefix = "STATE: -"; remptr = rem; + cupsMutexLock(&report_mutex); + fprintf(stderr, "DEBUG2: op='%c', new_reasons=%d, state_reasons=%d\n", op ? op : ' ', cupsArrayCount(new_reasons), cupsArrayCount(state_reasons)); - cupsMutexLock(&report_mutex); - if (op == '+') { /* diff --git a/scheduler/job.c b/scheduler/job.c index 7cd73da4bd..e9d0944fbc 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -1975,6 +1975,9 @@ cupsdLoadJob(cupsd_job_t *job) /* I - Job */ } job->num_files = 0; + + cupsRWUnlock(&MimeDatabase->lock); + return (0); } @@ -2614,7 +2617,7 @@ cupsdSetJobState( * reasons message there... */ - if (action >= CUPSD_JOB_FORCE && job && job->printer) + if (action >= CUPSD_JOB_FORCE && job->printer) ippSetString(job->attrs, &job->reasons, 0, "processing-to-stop-point"); break; }