Commit 90560498 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

pdh: Fix two missing LeaveCriticalSection() on error paths.

parent 1c7c9de4
...@@ -407,7 +407,11 @@ PDH_STATUS WINAPI PdhCloseQuery( PDH_HQUERY handle ) ...@@ -407,7 +407,11 @@ PDH_STATUS WINAPI PdhCloseQuery( PDH_HQUERY handle )
WaitForSingleObject( thread, INFINITE ); WaitForSingleObject( thread, INFINITE );
EnterCriticalSection( &pdh_handle_cs ); EnterCriticalSection( &pdh_handle_cs );
if (query->magic != PDH_MAGIC_QUERY) return ERROR_SUCCESS; if (query->magic != PDH_MAGIC_QUERY)
{
LeaveCriticalSection( &pdh_handle_cs );
return ERROR_SUCCESS;
}
CloseHandle( query->stop ); CloseHandle( query->stop );
CloseHandle( query->thread ); CloseHandle( query->thread );
query->thread = NULL; query->thread = NULL;
...@@ -530,7 +534,11 @@ PDH_STATUS WINAPI PdhCollectQueryDataEx( PDH_HQUERY handle, DWORD interval, HAND ...@@ -530,7 +534,11 @@ PDH_STATUS WINAPI PdhCollectQueryDataEx( PDH_HQUERY handle, DWORD interval, HAND
WaitForSingleObject( thread, INFINITE ); WaitForSingleObject( thread, INFINITE );
EnterCriticalSection( &pdh_handle_cs ); EnterCriticalSection( &pdh_handle_cs );
if (query->magic != PDH_MAGIC_QUERY) return PDH_INVALID_HANDLE; if (query->magic != PDH_MAGIC_QUERY)
{
LeaveCriticalSection( &pdh_handle_cs );
return PDH_INVALID_HANDLE;
}
CloseHandle( query->thread ); CloseHandle( query->thread );
query->thread = NULL; query->thread = NULL;
} }
......
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