don't segfault, by lmunch

SVN revision: 40254
This commit is contained in:
Gustavo Sverzut Barbieri 2009-04-20 20:57:02 +00:00
parent 4bc2ca60b0
commit 496d229e89
1 changed files with 6 additions and 3 deletions

View File

@ -928,9 +928,12 @@ _e_editable_text_insert(Evas_Object *editable, int pos, const char *text)
sd->text = old;
return 0;
}
memcpy(sd->text, old, prev_char_length + 1);
memset(old, 0, prev_char_length);
free(old);
if (old)
{
memcpy(sd->text, old, prev_char_length + 1);
memset(old, 0, prev_char_length);
free(old);
}
}
else
{