diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-11-29 11:31:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-11-29 11:32:41 +0300 |
commit | 3b467b35a85153e9435a1fbcba2e9c1770c1192a (patch) | |
tree | ddd5254aa74558ebf4036bd58b071961094fef6a /source/blender/python/mathutils/mathutils_bvhtree.c | |
parent | 9bea39c474f768ce6559dfe0315157db6e16f44c (diff) |
Fix T50029: BVHTree.FromPolygons memory leak
Diffstat (limited to 'source/blender/python/mathutils/mathutils_bvhtree.c')
-rw-r--r-- | source/blender/python/mathutils/mathutils_bvhtree.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/mathutils/mathutils_bvhtree.c b/source/blender/python/mathutils/mathutils_bvhtree.c index ff1761eb6d7..1eb8644a9a6 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.c +++ b/source/blender/python/mathutils/mathutils_bvhtree.c @@ -817,13 +817,14 @@ static PyObject *C_BVHTree_FromPolygons(PyObject *UNUSED(cls), PyObject *args, P PyErr_Format(PyExc_ValueError, "%s: index %d must be less than %d", error_prefix, plink->poly[j], coords_len); - - Py_DECREF(py_tricoords_fast); + /* decref below */ valid = false; break; } } + Py_DECREF(py_tricoords_fast); + if (py_tricoords_len >= 3) { tris_len += (py_tricoords_len - 2); } |