services: Don't double release process in service_start.

Fixes a crash while running ntoskrnl tests.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 496380709d)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
oldstable
Piotr Caban 2019-05-27 17:36:17 +02:00 committed by Michael Stefaniuc
parent c277654c3b
commit beeadfb055
1 changed files with 7 additions and 4 deletions

View File

@ -1066,10 +1066,13 @@ DWORD service_start(struct service_entry *service, DWORD service_argc, LPCWSTR *
if (err != ERROR_SUCCESS)
{
service_lock(service);
service->status.dwCurrentState = SERVICE_STOPPED;
service->process = NULL;
if (!--process->use_count) process_terminate(process);
release_process(process);
if (service->process)
{
service->status.dwCurrentState = SERVICE_STOPPED;
service->process = NULL;
if (!--process->use_count) process_terminate(process);
release_process(process);
}
service_unlock(service);
}