[PATCH 1/1] ddraw: Add missing unlock on error path. Found by Smatch.

Michael Stefaniuc mstefani at redhat.de
Tue Feb 19 12:50:04 CST 2008


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

diff --git a/dlls/ddraw/texture.c b/dlls/ddraw/texture.c
index 5d5bd52..224f8d6 100644
--- a/dlls/ddraw/texture.c
+++ b/dlls/ddraw/texture.c
@@ -369,7 +369,11 @@ IDirect3DTextureImpl_Load(IDirect3DTexture2 *iface,
         {
             PALETTEENTRY palent[256];
 
-            if (pal == NULL) return DDERR_NOPALETTEATTACHED;
+            if (pal == NULL)
+            {
+                LeaveCriticalSection(&ddraw_cs);
+                return DDERR_NOPALETTEATTACHED;
+            }
             IDirectDrawPalette_GetEntries(pal_src, 0, 0, 256, palent);
             IDirectDrawPalette_SetEntries(pal, 0, 0, 256, palent);
         }
-- 
1.5.4.1
-------------- 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/20080219/e9c30c2a/attachment.pgp 


More information about the wine-patches mailing list