diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-05-28 01:33:48 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-05-28 01:33:48 +0400 |
commit | bcc314311969959df482dd5525703533d875d023 (patch) | |
tree | 5e5a622471e0214b3ba481ba503ecee1cfa6b06c /source/blender/python/api2_2x/Mesh.c | |
parent | d9e85385fd083ef11ccc4ffa06f9120599f18510 (diff) |
more memory leak fixes, though only a few are likely to happen
Diffstat (limited to 'source/blender/python/api2_2x/Mesh.c')
-rw-r--r-- | source/blender/python/api2_2x/Mesh.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Mesh.c b/source/blender/python/api2_2x/Mesh.c index acb95919916..30b67426e6a 100644 --- a/source/blender/python/api2_2x/Mesh.c +++ b/source/blender/python/api2_2x/Mesh.c @@ -6200,14 +6200,17 @@ static PyObject *Mesh_getVertsFromGroup( BPy_Mesh* self, PyObject * args ) for( i = 0; i < PyList_Size( listObject ); i++ ) { PyObject *attr = NULL; - if( !PyArg_Parse( PyList_GetItem( listObject, i ), "i", &num ) ) + if( !PyArg_Parse( PyList_GetItem( listObject, i ), "i", &num ) ) { + Py_DECREF(tempVertexList); return EXPP_ReturnPyObjError( PyExc_TypeError, "python list integer not parseable" ); + } - if( num < 0 || num >= mesh->totvert ) + if( num < 0 || num >= mesh->totvert ) { + Py_DECREF(tempVertexList); return EXPP_ReturnPyObjError( PyExc_ValueError, "bad vertex index in list" ); - + } dvert = mesh->dvert + num; for( k = 0; k < dvert->totweight; k++ ) { if( dvert->dw[k].def_nr == nIndex ) { |