diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-19 14:41:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-19 14:41:16 +0400 |
commit | 02468b290a9c4246767ed4d1fcaa222de71d1ad5 (patch) | |
tree | 707946a0d14a487450a67682e1a01328d4f66927 /source/blender/blenkernel/intern/mesh.c | |
parent | 2d97a096d7621918d7385a37429153a1512fbf14 (diff) |
code cleanup: use MEM_mallocN rather then MEM_callocN when the array is
overwritten immediately after.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index f24a55dcc44..439965420f7 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -2189,10 +2189,13 @@ static void bm_corners_to_loops_ex(ID *id, CustomData *fdata, CustomData *ldata, if (ld->disps) MEM_freeN(ld->disps); - ld->disps = MEM_callocN(sizeof(float) * 3 * side * side, "converted loop mdisps"); + ld->disps = MEM_mallocN(sizeof(float) * 3 * side * side, "converted loop mdisps"); if (fd->disps) { memcpy(ld->disps, disps, sizeof(float) * 3 * side * side); } + else { + memset(ld->disps, 0, sizeof(float) * 3 * side * side); + } } } } |