Text3d.c NULL pointer check added to get rid of MEM_freeN warning.

This commit is contained in:
Mika Saari 2005-09-29 19:25:12 +00:00
parent 83b2d267b5
commit a6bd07d10f

@ -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 );