Henri Verbeet : wined3d: Cleanup properly if creating the context array fails in CreateAdditionalSwapChain ().

Alexandre Julliard julliard at winehq.org
Wed Oct 15 10:08:42 CDT 2008


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Oct 15 13:35:31 2008 +0200

wined3d: Cleanup properly if creating the context array fails in CreateAdditionalSwapChain().

---

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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 7e62d24..3111993 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1550,8 +1550,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
     /** FIXME: Handle stencil appropriately via EnableAutoDepthStencil / AutoDepthStencilFormat **/
 
     object->context = HeapAlloc(GetProcessHeap(), 0, sizeof(object->context));
-    if(!object->context)
-        return E_OUTOFMEMORY;
+    if(!object->context) {
+        ERR("Failed to create the context array\n");
+        hr = E_OUTOFMEMORY;
+        goto error;
+    }
     object->num_contexts = 1;
 
     if(surface_type == SURFACE_OPENGL) {




More information about the wine-cvs mailing list