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-03-06 19:05:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-03-12 15:49:15 +0300
commit42c7200248dc0ab2971f8ce408888e28f4b1b182 (patch)
treeea011673d3aa16955f6d23026f8851f8c2d07902
parent56f794fce60f6e3681b8445403d4826371b3b365 (diff)
CustomData: don't calloc when duplicating layers
-rw-r--r--source/blender/blenkernel/intern/customdata.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 483a4b979b9..65ec6be5a60 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -1810,7 +1810,13 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data, int typ
newlayerdata = layerdata;
}
else if (size > 0) {
- newlayerdata = MEM_callocN(size, layerType_getName(type));
+ if (alloctype == CD_DUPLICATE && layerdata) {
+ newlayerdata = MEM_mallocN(size, layerType_getName(type));
+ }
+ else {
+ newlayerdata = MEM_callocN(size, layerType_getName(type));
+ }
+
if (!newlayerdata)
return NULL;
}