From 01cba076249afcf799ec967ce6b9e7a794798df3 Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 19 Feb 2008 19:50:04 +0100 Subject: [PATCH] ddraw: Add missing unlock on error path. Found by Smatch. --- dlls/ddraw/texture.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/ddraw/texture.c b/dlls/ddraw/texture.c index 5d5bd52fa6f..224f8d61245 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); }