[PATCH] d3dxof: Prevent accessing pobj when it is null. This can happend on error.
Christian Costa
titan.costa at gmail.com
Sun Jan 22 10:58:56 CST 2012
---
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-patches
mailing list