Commit 83bcb752 authored by Fabian Maurer's avatar Fabian Maurer Committed by Alexandre Julliard

localspl: In fpScheduleJob leave critical section in error case (Coverity).

parent 0459802a
...@@ -3783,7 +3783,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id) ...@@ -3783,7 +3783,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id)
{ {
printer_t *printer = (printer_t *)hprinter; printer_t *printer = (printer_t *)hprinter;
WCHAR output[1024], name[1024], *datatype; WCHAR output[1024], name[1024], *datatype;
BOOL datatype_valid = FALSE, ret = TRUE; BOOL datatype_valid = FALSE, ret = FALSE;
PRINTPROCESSOROPENDATA pp_data; PRINTPROCESSOROPENDATA pp_data;
const WCHAR *port_name, *port; const WCHAR *port_name, *port;
job_info_t *job; job_info_t *job;
...@@ -3852,8 +3852,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id) ...@@ -3852,8 +3852,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id)
if (!datatype_valid) if (!datatype_valid)
{ {
pp = print_proc_load(printer->print_proc); pp = print_proc_load(printer->print_proc);
if (!pp) if (!pp) goto cleanup;
return FALSE;
datatype_valid = print_proc_check_datatype(pp, datatype); datatype_valid = print_proc_check_datatype(pp, datatype);
} }
...@@ -3863,7 +3862,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id) ...@@ -3863,7 +3862,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id)
WARN("%s datatype not supported by %s\n", debugstr_w(datatype), WARN("%s datatype not supported by %s\n", debugstr_w(datatype),
debugstr_w(printer->info->print_proc)); debugstr_w(printer->info->print_proc));
print_proc_unload(pp); print_proc_unload(pp);
return FALSE; goto cleanup;
} }
swprintf(name, ARRAY_SIZE(name), L"%s, Port", port_name); swprintf(name, ARRAY_SIZE(name), L"%s, Port", port_name);
...@@ -3879,7 +3878,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id) ...@@ -3879,7 +3878,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id)
{ {
WARN("OpenPrintProcessor failed %ld\n", GetLastError()); WARN("OpenPrintProcessor failed %ld\n", GetLastError());
print_proc_unload(pp); print_proc_unload(pp);
return FALSE; goto cleanup;
} }
swprintf(name, ARRAY_SIZE(name), L"%s, Job %d", printer->name, job->id); swprintf(name, ARRAY_SIZE(name), L"%s, Job %d", printer->name, job->id);
...@@ -3892,6 +3891,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id) ...@@ -3892,6 +3891,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id)
if (!(printer->info->attributes & PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS)) if (!(printer->info->attributes & PRINTER_ATTRIBUTE_KEEPPRINTEDJOBS))
DeleteFileW(job->filename); DeleteFileW(job->filename);
free_job(job); free_job(job);
cleanup:
LeaveCriticalSection(&printer->info->jobs_cs); LeaveCriticalSection(&printer->info->jobs_cs);
return ret; return ret;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment