diff --git a/source/blender/python/mathutils/mathutils_bvhtree.cc b/source/blender/python/mathutils/mathutils_bvhtree.cc index 7565f5a6aba..4caebb27cc1 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.cc +++ b/source/blender/python/mathutils/mathutils_bvhtree.cc @@ -1145,7 +1145,7 @@ static PyObject *C_BVHTree_FromObject(PyObject * /*cls*/, PyObject *args, PyObje float(*coords)[3] = static_cast( MEM_mallocN(sizeof(*coords) * size_t(coords_len), __func__)); - uint(*tris)[3] = tris = static_cast( + uint(*tris)[3] = static_cast( MEM_mallocN(sizeof(*tris) * size_t(looptris.size()), __func__)); memcpy(coords, BKE_mesh_vert_positions(mesh), sizeof(float[3]) * size_t(mesh->totvert));