Commit 13b3b724 authored by Paul Vriens's avatar Paul Vriens Committed by Alexandre Julliard

advapi/service: Fix possible handle leak.

parent 05fec6c8
...@@ -1262,7 +1262,10 @@ SC_HANDLE WINAPI OpenServiceW( SC_HANDLE hSCManager, LPCWSTR lpServiceName, ...@@ -1262,7 +1262,10 @@ SC_HANDLE WINAPI OpenServiceW( SC_HANDLE hSCManager, LPCWSTR lpServiceName,
sizeof (struct sc_service) + len*sizeof(WCHAR), sizeof (struct sc_service) + len*sizeof(WCHAR),
sc_handle_destroy_service ); sc_handle_destroy_service );
if (!hsvc) if (!hsvc)
{
RegCloseKey(hKey);
return NULL; return NULL;
}
strcpyW( hsvc->name, lpServiceName ); strcpyW( hsvc->name, lpServiceName );
hsvc->hkey = hKey; hsvc->hkey = hKey;
hsvc->dwAccess = dwDesiredAccess; hsvc->dwAccess = dwDesiredAccess;
......
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