Hello,

I found a possibly memory leak in the patch.
In this function:

+static HRESULT parse_mesh(IDirectXFileData *filedata, struct mesh_data 
*mesh_data, DWORD provide_flags)
These may leak the allocated blocks:
+
+    mesh_data->vertices = HeapAlloc(GetProcessHeap(), 0,
+            mesh_data->num_vertices * sizeof(*mesh_data->vertices));
+    mesh_data->num_tri_per_face = HeapAlloc(GetProcessHeap(), 0,
+            mesh_data->num_poly_faces * sizeof(*mesh_data->num_tri_per_face));
+    mesh_data->indices = HeapAlloc(GetProcessHeap(), 0,
+            (mesh_data->num_tri_faces + mesh_data->num_poly_faces * 2) * 
sizeof(*mesh_data->indices));
+    if (!mesh_data->vertices || !mesh_data->num_tri_per_face || 
!mesh_data->indices)
+        return E_OUTOFMEMORY;
+

HTH,
Joris


Reply via email to