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:
authorGermano Cavalcante <germano.costa@ig.com.br>2022-04-13 04:16:09 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-04-13 04:16:09 +0300
commit17a19069db407b80bf6fbaf97e07bc239cf75e84 (patch)
treec9bed59d05d3f8ba8babf12f7390070a870b5308
parentcd4a9c488f66abccf3e35a33adbf2630a389ae67 (diff)
Fix cases where 'Py_buffer' might not be released
-rw-r--r--source/blender/python/gpu/gpu_py_element.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/python/gpu/gpu_py_element.c b/source/blender/python/gpu/gpu_py_element.c
index f2836576659..04975fcef96 100644
--- a/source/blender/python/gpu/gpu_py_element.c
+++ b/source/blender/python/gpu/gpu_py_element.c
@@ -70,12 +70,14 @@ static PyObject *pygpu_IndexBuf__tp_new(PyTypeObject *UNUSED(type), PyObject *ar
if (pybuffer.ndim != 1 && pybuffer.shape[1] != verts_per_prim) {
PyErr_Format(PyExc_ValueError, "Each primitive must exactly %d indices", verts_per_prim);
+ PyBuffer_Release(&pybuffer);
return NULL;
}
if (pybuffer.itemsize != 4 ||
PyC_StructFmt_type_is_float_any(PyC_StructFmt_type_from_str(pybuffer.format))) {
PyErr_Format(PyExc_ValueError, "Each index must be an 4-bytes integer value");
+ PyBuffer_Release(&pybuffer);
return NULL;
}