diff --git a/source/blender/python/api2_2x/Text3d.c b/source/blender/python/api2_2x/Text3d.c index c1d2966d2aa..504ca9252c3 100644 --- a/source/blender/python/api2_2x/Text3d.c +++ b/source/blender/python/api2_2x/Text3d.c @@ -491,7 +491,8 @@ static PyObject *Text3d_setText( BPy_Text3d * self, PyObject * args ) "expected string argument" ) ); if( self ) { MEM_freeN( self->curve->str ); - MEM_freeN(self->curve->strinfo); + if(self->curve->strinfo != NULL) + MEM_freeN(self->curve->strinfo); self->curve->strinfo = MEM_callocN((strlen(text)+1)*sizeof(CharInfo), "strinfo"); self->curve->str = MEM_mallocN( strlen (text)+1, "str" ); strcpy( self->curve->str, text );