diff options
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_query.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c index 45a42c29d84..1bc5b70f874 100644 --- a/source/blender/bmesh/intern/bmesh_query.c +++ b/source/blender/bmesh/intern/bmesh_query.c @@ -2234,7 +2234,9 @@ int BM_mesh_calc_face_groups(BMesh *bm, MEM_freeN(stack); /* reduce alloc to required size */ - group_index = MEM_reallocN(group_index, sizeof(*group_index) * group_curr); + if (group_index_len != group_curr) { + group_index = MEM_reallocN(group_index, sizeof(*group_index) * group_curr); + } *r_group_index = group_index; return group_curr; @@ -2354,7 +2356,9 @@ int BM_mesh_calc_edge_groups(BMesh *bm, MEM_freeN(stack); /* reduce alloc to required size */ - group_index = MEM_reallocN(group_index, sizeof(*group_index) * group_curr); + if (group_index_len != group_curr) { + group_index = MEM_reallocN(group_index, sizeof(*group_index) * group_curr); + } *r_group_index = group_index; return group_curr; |