diff options
Diffstat (limited to 'source/blender/python/api2_2x/Sound.c')
-rw-r--r-- | source/blender/python/api2_2x/Sound.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Sound.c b/source/blender/python/api2_2x/Sound.c index 75e67f94aae..350d04e5a63 100644 --- a/source/blender/python/api2_2x/Sound.c +++ b/source/blender/python/api2_2x/Sound.c @@ -243,11 +243,12 @@ static PyObject *M_Sound_Get( PyObject * self, PyObject * args ) while( snd_iter ) { pyobj = Sound_CreatePyObject( snd_iter ); - if( !pyobj ) + if( !pyobj ) { + Py_DECREF(snd_list); return ( EXPP_ReturnPyObjError ( PyExc_MemoryError, "couldn't create PyObject" ) ); - + } PyList_SET_ITEM( snd_list, index, pyobj ); snd_iter = snd_iter->id.next; |