diff options
Diffstat (limited to 'source/blender/python/api2_2x/Material.c')
-rw-r--r-- | source/blender/python/api2_2x/Material.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Material.c b/source/blender/python/api2_2x/Material.c index 7bf80efa680..019c3d750b9 100644 --- a/source/blender/python/api2_2x/Material.c +++ b/source/blender/python/api2_2x/Material.c @@ -309,11 +309,12 @@ static PyObject *M_Material_Get( PyObject * self, PyObject * args ) while( mat_iter ) { pyobj = Material_CreatePyObject( mat_iter ); - if( !pyobj ) + if( !pyobj ) { + Py_DECREF(matlist); return ( EXPP_ReturnPyObjError ( PyExc_MemoryError, "couldn't create PyObject" ) ); - + } PyList_SET_ITEM( matlist, index, pyobj ); mat_iter = mat_iter->id.next; |