secur32: Missing LeaveCriticalSection on error paths (found by Smatch)

Michael Stefaniuc mstefani at redhat.de
Mon May 1 08:56:53 CDT 2006


---

 dlls/secur32/secur32.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

7c373efbe8279d9e7937ba140756771d9dabf0c2
diff --git a/dlls/secur32/secur32.c b/dlls/secur32/secur32.c
index 4757782..ebe7e2e 100644
--- a/dlls/secur32/secur32.c
+++ b/dlls/secur32/secur32.c
@@ -396,14 +396,20 @@ SecureProvider *SECUR32_addProvider(cons
     {
         providerTable = HeapAlloc(GetProcessHeap(), 0, sizeof(SecureProviderTable));
         if (!providerTable)
+        {
+            LeaveCriticalSection(&cs);
             return NULL;
+        }
 
         list_init(&providerTable->table);
     }
 
     ret = HeapAlloc(GetProcessHeap(), 0, sizeof(SecureProvider));
     if (!ret)
+    {
+        LeaveCriticalSection(&cs);
         return NULL;
+    }
 
     list_add_tail(&providerTable->table, &ret->entry);
     ret->lib = NULL;
@@ -439,7 +445,10 @@ void SECUR32_addPackages(SecureProvider 
     {
         packageTable = HeapAlloc(GetProcessHeap(), 0, sizeof(SecurePackageTable));
         if (!packageTable)
+        {
+            LeaveCriticalSection(&cs);
             return;
+        }
 
         packageTable->numPackages = 0;
         list_init(&packageTable->table);
-- 
1.3.0


-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at redhat.com
Hauptstaetterstr. 58            http://www.redhat.de/
D-70178 Stuttgart
-------------- 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/20060501/8df9dadc/attachment.pgp


More information about the wine-patches mailing list