Fixing bad realloc usage.

By Fabiano Fidêncio.



SVN revision: 50790
This commit is contained in:
Gustavo Lima Chaves 2010-08-03 22:15:02 +00:00
parent 1837b63b38
commit 50190aeb22
1 changed files with 12 additions and 0 deletions

View File

@ -2716,6 +2716,12 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name, double
tmp = realloc(rp->part->other_desc,
sizeof (Edje_Part_Description_Common *) * (rp->part->other_count + 1));
if (!tmp)
{
free(pd);
return;
}
rp->part->other_desc = tmp;
rp->part->other_desc[rp->part->other_count++] = pd;
}
@ -2901,6 +2907,12 @@ edje_edit_state_copy(Evas_Object *obj, const char *part, const char *from, doubl
tmp = realloc(rp->part->other_desc,
sizeof (Edje_Part_Description_Common *) * (rp->part->other_count + 1));
if (!tmp)
{
free(pdto);
return EINA_FALSE;
}
rp->part->other_desc = tmp;
rp->part->other_desc[rp->part->other_count++] = pdto;
pdto->state.name = eina_stringshare_add(to);