Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-02-20 09:09:40 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-02-20 09:09:40 +0300
commit1ec83f41c1be97e757ebdca357b39ee0cca240c1 (patch)
tree50bf446e2f11e1757f8f70f320902deb54cf29b1 /source/blender/blenkernel/intern/mesh_mapping.c
parent83220ab7fb9af6a34b30cdcb0ba9394e710d418b (diff)
Fix possible (unlikely) memory leak
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_mapping.c')
-rw-r--r--source/blender/blenkernel/intern/mesh_mapping.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/mesh_mapping.c b/source/blender/blenkernel/intern/mesh_mapping.c
index 9e490ae6766..8d9fbe46f19 100644
--- a/source/blender/blenkernel/intern/mesh_mapping.c
+++ b/source/blender/blenkernel/intern/mesh_mapping.c
@@ -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;