edje entry - fix coverity CID 1357752

fix potential crash if calloc fails and sel is NULL

@fix
This commit is contained in:
Carsten Haitzler 2016-07-24 18:21:07 +09:00
parent 10f7641dda
commit 35e39f4145
1 changed files with 16 additions and 10 deletions

View File

@ -1122,19 +1122,25 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en)
Evas_Object *ob;
sel = calloc(1, sizeof(Sel));
an->sel = eina_list_append(an->sel, sel);
if (ed->item_provider.func)
if (sel)
{
ob = _item_obj_get(an, o, smart, clip);
sel->obj = ob;
an->sel = eina_list_append(an->sel, sel);
if (ed->item_provider.func)
{
ob = _item_obj_get(an, o, smart, clip);
sel->obj = ob;
}
}
}
/* We have only one sel per item */
sel = an->sel->data;
evas_object_move(sel->obj, x + cx, y + cy);
evas_object_resize(sel->obj, cw, ch);
evas_object_show(sel->obj);
if (sel)
{
/* We have only one sel per item */
sel = an->sel->data;
evas_object_move(sel->obj, x + cx, y + cy);
evas_object_resize(sel->obj, cw, ch);
evas_object_show(sel->obj);
}
}
// for link anchors
else