Marcus Meissner : wined3d: Check for NULL before context_release (Coverity) .

Alexandre Julliard julliard at winehq.org
Tue Nov 3 15:37:17 CST 2009


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

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Sun Nov  1 16:05:19 2009 +0100

wined3d: Check for NULL before context_release (Coverity).

---

 dlls/wined3d/surface.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 8c143ec..221f16e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4983,7 +4983,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D
                 mem = HeapAlloc(GetProcessHeap(), 0, outpitch * height);
                 if(!mem) {
                     ERR("Out of memory %d, %d!\n", outpitch, height);
-                    context_release(context);
+                    if (context) context_release(context);
                     return WINED3DERR_OUTOFVIDEOMEMORY;
                 }
                 d3dfmt_convert_surface(This->resource.allocatedMemory, mem, pitch, width, height, outpitch, convert, This);




More information about the wine-cvs mailing list