Christian Costa : d3dxof: Prevent accessing pobj when it is null. This can happend on error.

Alexandre Julliard julliard at winehq.org
Mon Jan 23 13:00:57 CST 2012


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

Author: Christian Costa <titan.costa at gmail.com>
Date:   Sun Jan 22 17:58:56 2012 +0100

d3dxof: Prevent accessing pobj when it is null. This can happend on error.

---

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

diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c
index ab13f17..3a6ce20 100644
--- a/dlls/d3dxof/d3dxof.c
+++ b/dlls/d3dxof/d3dxof.c
@@ -522,8 +522,11 @@ static ULONG WINAPI IDirectXFileDataImpl_Release(IDirectXFileData* iface)
     if (!This->level && !This->from_ref)
     {
       HeapFree(GetProcessHeap(), 0, This->pstrings);
-      HeapFree(GetProcessHeap(), 0, This->pobj->pdata);
-      HeapFree(GetProcessHeap(), 0, This->pobj);
+      if (This->pobj)
+      {
+        HeapFree(GetProcessHeap(), 0, This->pobj->pdata);
+        HeapFree(GetProcessHeap(), 0, This->pobj);
+      }
     }
     HeapFree(GetProcessHeap(), 0, This);
   }




More information about the wine-cvs mailing list