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

Michael Stefaniuc mstefani at redhat.de
Tue Oct 30 15:10:09 CDT 2007


---
 dlls/pdh/pdh_main.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/pdh/pdh_main.c b/dlls/pdh/pdh_main.c
index 37613ed..69c12df 100644
--- a/dlls/pdh/pdh_main.c
+++ b/dlls/pdh/pdh_main.c
@@ -407,7 +407,11 @@ PDH_STATUS WINAPI PdhCloseQuery( PDH_HQUERY handle )
         WaitForSingleObject( thread, INFINITE );
 
         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->thread );
         query->thread = NULL;
@@ -530,7 +534,11 @@ PDH_STATUS WINAPI PdhCollectQueryDataEx( PDH_HQUERY handle, DWORD interval, HAND
         WaitForSingleObject( thread, INFINITE );
 
         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 );
         query->thread = NULL;
     }
-- 
1.5.3.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20071030/8f9d0ff7/attachment.pgp 


More information about the wine-patches mailing list