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>
This commit is contained in:
Piotr Caban 2019-05-27 17:36:17 +02:00 committed by Alexandre Julliard
parent 294cfaf077
commit 496380709d
1 changed files with 7 additions and 4 deletions

View File

@ -1069,10 +1069,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);
}