shell32: Fix missing unlock on an error path. Found by Smatch.

Michael Stefaniuc mstefani at redhat.de
Mon Jul 16 15:10:02 CDT 2007


---
 dlls/shell32/shlfolder.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c
index e198ba9..cbbd12f 100644
--- a/dlls/shell32/shlfolder.c
+++ b/dlls/shell32/shlfolder.c
@@ -248,7 +248,11 @@ static void add_iface_to_cache(REFCLSID clsid, LPVOID pv)
             sf_cls_cache_entry = HeapReAlloc(GetProcessHeap(), 0, sf_cls_cache.sf_cls_cache_entry,
                                              allocated * sizeof(*sf_cls_cache_entry));
         }
-        if (!sf_cls_cache_entry) return;
+        if (!sf_cls_cache_entry)
+        {
+            LeaveCriticalSection(&SHELL32_SF_ClassCacheCS);
+            return;
+        }
 
         sf_cls_cache.allocated = allocated;
         sf_cls_cache.sf_cls_cache_entry = sf_cls_cache_entry;
-- 
1.5.2.2


-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
-------------- 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/20070716/4207e971/attachment.pgp


More information about the wine-patches mailing list