cnp: Add safety check for NULL pointer from calloc() for anim_icon.

Summary:
It could be failed to allocate memory for Anim_Icon.
CID - 337351
@fix

Reviewers: raster, thiepha, woohyun, Hermet

Differential Revision: https://phab.enlightenment.org/D2672
This commit is contained in:
Youngbok Shin 2015-06-12 11:01:55 +03:00 committed by Daniel Zaoui
parent e227bad7fe
commit 9fba74ea72
1 changed files with 7 additions and 0 deletions

View File

@ -4339,6 +4339,13 @@ _anim_icons_make(Eina_List *icons)
EINA_LIST_FOREACH(icons, itr, o)
{ /* Now add icons to animation window */
Anim_Icon *st = calloc(1, sizeof(*st));
if (!st)
{
ERR("Failed to allocate memory for icon!");
continue;
}
evas_object_geometry_get(o, &st->start_x, &st->start_y, &st->start_w, &st->start_h);
evas_object_show(o);
st->o = o;