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>2021-09-16 09:38:02 +0300
committerJeroen Bakker <jeroen@blender.org>2021-09-22 09:29:47 +0300
commitec448d5a6ac057593bb272417397f04324a6110b (patch)
tree392424d012d8e9a8c21f4b7b4cccfa490cd1c608 /source/blender/python
parente90aabdebfa1561daa8d7725b90a81014d46ebb2 (diff)
Fix memory leak if an error occurred assigning id-property sequence
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/generic/idprop_py_api.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index fc7054f675a..846f36ff1a1 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -520,6 +520,7 @@ static IDProperty *idp_from_PySequence_Fast(const char *name, PyObject *ob)
for (i = 0; i < val.array.len; i++) {
item = ob_seq_fast_items[i];
if (((prop_data[i] = PyFloat_AsDouble(item)) == -1.0) && PyErr_Occurred()) {
+ IDP_FreeProperty(prop);
return NULL;
}
}
@@ -532,6 +533,7 @@ static IDProperty *idp_from_PySequence_Fast(const char *name, PyObject *ob)
for (i = 0; i < val.array.len; i++) {
item = ob_seq_fast_items[i];
if (((prop_data[i] = PyC_Long_AsI32(item)) == -1) && PyErr_Occurred()) {
+ IDP_FreeProperty(prop);
return NULL;
}
}
@@ -542,6 +544,7 @@ static IDProperty *idp_from_PySequence_Fast(const char *name, PyObject *ob)
for (i = 0; i < val.array.len; i++) {
item = ob_seq_fast_items[i];
if (BPy_IDProperty_Map_ValidateAndCreate(NULL, prop, item) == false) {
+ IDP_FreeProperty(prop);
return NULL;
}
}