Fix possible (unlikely) memory leak

This commit is contained in:
2015-02-20 17:09:40 +11:00
parent 83220ab7fb
commit 1ec83f41c1

View File

@@ -724,8 +724,8 @@ bool BKE_mesh_calc_islands_loop_poly_uv(
MeshElemMap *edge_poly_map;
int *edge_poly_mem;
int *poly_indices = MEM_mallocN(sizeof(*poly_indices) * (size_t)totpoly, __func__);
int *loop_indices = MEM_mallocN(sizeof(*loop_indices) * (size_t)totloop, __func__);
int *poly_indices;
int *loop_indices;
int num_pidx, num_lidx;
/* Those are used to detect 'inner cuts', i.e. edges that are borders, and yet have two or more polys of
@@ -758,6 +758,9 @@ bool BKE_mesh_calc_islands_loop_poly_uv(
edge_innercut_indices = MEM_mallocN(sizeof(*edge_innercut_indices) * (size_t)num_edge_borders, __func__);
}
poly_indices = MEM_mallocN(sizeof(*poly_indices) * (size_t)totpoly, __func__);
loop_indices = MEM_mallocN(sizeof(*loop_indices) * (size_t)totloop, __func__);
/* Note: here we ignore '0' invalid group - this should *never* happen in this case anyway? */
for (grp_idx = 1; grp_idx <= num_poly_groups; grp_idx++) {
num_pidx = num_lidx = 0;