CustomData: don't calloc when duplicating layers
This commit is contained in:
parent
56f794fce6
commit
42c7200248
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue