diff options
Diffstat (limited to 'source/blender/python/api2_2x/Lamp.c')
-rw-r--r-- | source/blender/python/api2_2x/Lamp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c index 6be02c45720..84e755b64a0 100644 --- a/source/blender/python/api2_2x/Lamp.c +++ b/source/blender/python/api2_2x/Lamp.c @@ -704,10 +704,12 @@ static PyObject *M_Lamp_Get( PyObject * self, PyObject * args ) while( lamp_iter ) { pyobj = Lamp_CreatePyObject( lamp_iter ); - if( !pyobj ) + if( !pyobj ) { + Py_DECREF(lamplist); return ( EXPP_ReturnPyObjError ( PyExc_MemoryError, - "couldn't create PyString" ) ); + "couldn't create PyLamp" ) ); + } PyList_SET_ITEM( lamplist, index, pyobj ); |