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>2018-07-01 11:26:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-07-01 11:26:37 +0300
commitfadad17c588115e0460b996afacaddb3b29d12d7 (patch)
tree52006c2f95734e6f738d922e089a5e644f48efc3
parent9738de820ae7f4ff4b906e6f1078a89cc806dff6 (diff)
Cleanup: avoid calloc when immediately overwritten
-rw-r--r--source/blender/makesrna/intern/rna_define.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c
index 2177c7b980a..14db1dbb847 100644
--- a/source/blender/makesrna/intern/rna_define.c
+++ b/source/blender/makesrna/intern/rna_define.c
@@ -3415,7 +3415,7 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA
BoolPropertyRNA *bprop = (BoolPropertyRNA *)prop;
if (bprop->defaultarray) {
- iarray = MEM_callocN(sizeof(int) * prop->totarraylength, "RNA_def_property_store");
+ iarray = MEM_mallocN(sizeof(int) * prop->totarraylength, "RNA_def_property_store");
memcpy(iarray, bprop->defaultarray, sizeof(int) * prop->totarraylength);
bprop->defaultarray = iarray;
}
@@ -3426,7 +3426,7 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA
IntPropertyRNA *iprop = (IntPropertyRNA *)prop;
if (iprop->defaultarray) {
- iarray = MEM_callocN(sizeof(int) * prop->totarraylength, "RNA_def_property_store");
+ iarray = MEM_mallocN(sizeof(int) * prop->totarraylength, "RNA_def_property_store");
memcpy(iarray, iprop->defaultarray, sizeof(int) * prop->totarraylength);
iprop->defaultarray = iarray;
}
@@ -3437,7 +3437,7 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA
EnumPropertyRNA *eprop = (EnumPropertyRNA *)prop;
if (eprop->item) {
- earray = MEM_callocN(sizeof(EnumPropertyItem) * (eprop->totitem + 1), "RNA_def_property_store");
+ earray = MEM_mallocN(sizeof(EnumPropertyItem) * (eprop->totitem + 1), "RNA_def_property_store");
memcpy(earray, eprop->item, sizeof(EnumPropertyItem) * (eprop->totitem + 1));
eprop->item = earray;
@@ -3457,7 +3457,7 @@ void RNA_def_property_duplicate_pointers(StructOrFunctionRNA *cont_, PropertyRNA
FloatPropertyRNA *fprop = (FloatPropertyRNA *)prop;
if (fprop->defaultarray) {
- farray = MEM_callocN(sizeof(float) * prop->totarraylength, "RNA_def_property_store");
+ farray = MEM_mallocN(sizeof(float) * prop->totarraylength, "RNA_def_property_store");
memcpy(farray, fprop->defaultarray, sizeof(float) * prop->totarraylength);
fprop->defaultarray = farray;
}