Michael Stefaniuc : ddraw: Add missing unlock on error path. Found by Smatch.

Alexandre Julliard julliard at winehq.org
Tue Feb 19 13:59:14 CST 2008


Module: wine
Branch: master
Commit: 01cba076249afcf799ec967ce6b9e7a794798df3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=01cba076249afcf799ec967ce6b9e7a794798df3

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Tue Feb 19 19:50:04 2008 +0100

ddraw: Add missing unlock on error path. Found by Smatch.

---

 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);
         }




More information about the wine-cvs mailing list