[2/2] d3dx9: Implement D3DXLoadMeshHierarchy for basic mesh hierarchy.

Joris Huizer joris_huizer at yahoo.com
Thu May 19 05:16:03 CDT 2011


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



More information about the wine-devel mailing list