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/Curve.c | |
parent | d9e85385fd083ef11ccc4ffa06f9120599f18510 (diff) |
more memory leak fixes, though only a few are likely to happen
Diffstat (limited to 'source/blender/python/api2_2x/Curve.c')
-rw-r--r-- | source/blender/python/api2_2x/Curve.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Curve.c b/source/blender/python/api2_2x/Curve.c index 04ed142f4dd..109a4572387 100644 --- a/source/blender/python/api2_2x/Curve.c +++ b/source/blender/python/api2_2x/Curve.c @@ -481,7 +481,7 @@ static PyObject *Curve_setControlPoint( BPy_Curve * self, PyObject * args ) static PyObject *Curve_getControlPoint( BPy_Curve * self, PyObject * args ) { - PyObject *liste = PyList_New( 0 ); /* return values */ + PyObject *liste; PyObject *item; Nurb *ptrnurb; @@ -498,7 +498,7 @@ static PyObject *Curve_getControlPoint( BPy_Curve * self, PyObject * args ) /* if no nurbs in this curve obj */ if( !self->curve->nurb.first ) - return liste; + return PyList_New( 0 ); /* walk the list of nurbs to find requested numcourbe */ ptrnurb = self->curve->nurb.first; @@ -513,7 +513,8 @@ static PyObject *Curve_getControlPoint( BPy_Curve * self, PyObject * args ) if( numpoint >= ptrnurb->pntsu ) return ( EXPP_ReturnPyObjError( PyExc_ValueError, "point index out of range" ) ); - + + liste = PyList_New( 0 ); if( ptrnurb->bp ) { /* if we are a nurb curve, you get 4 values */ for( i = 0; i < 4; i++ ) { item = PyFloat_FromDouble( ptrnurb->bp[numpoint].vec[i] ); |