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:
Diffstat (limited to 'source/blender/python/intern/bpy_rna_id_collection.c')
-rw-r--r--source/blender/python/intern/bpy_rna_id_collection.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/python/intern/bpy_rna_id_collection.c b/source/blender/python/intern/bpy_rna_id_collection.c
index 5f18a64a8a2..72c808aa630 100644
--- a/source/blender/python/intern/bpy_rna_id_collection.c
+++ b/source/blender/python/intern/bpy_rna_id_collection.c
@@ -170,6 +170,8 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject *
PyObject *ret = NULL;
+ IDUserMapData data_cb = {NULL};
+
static const char *_keywords[] = {"subset", "key_types", "value_types", NULL};
static _PyArg_Parser _parser = {"|O$O!O!:user_map", _keywords, 0};
if (!_PyArg_ParseTupleAndKeywordsFast(
@@ -197,8 +199,6 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject *
}
}
- IDUserMapData data_cb = {NULL};
-
if (subset) {
PyObject *subset_fast = PySequence_Fast(subset, "user_map");
if (subset_fast == NULL) {
@@ -268,13 +268,15 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject *
ret = data_cb.user_map;
error:
- Py_XDECREF(data_cb.py_id_key_lookup_only);
+ if (data_cb.py_id_key_lookup_only != NULL) {
+ Py_XDECREF(data_cb.py_id_key_lookup_only);
+ }
- if (key_types_bitmap) {
+ if (key_types_bitmap != NULL) {
MEM_freeN(key_types_bitmap);
}
- if (val_types_bitmap) {
+ if (val_types_bitmap != NULL) {
MEM_freeN(val_types_bitmap);
}