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,6 +1122,8 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en)
Evas_Object *ob;
sel = calloc(1, sizeof(Sel));
if (sel)
{
an->sel = eina_list_append(an->sel, sel);
if (ed->item_provider.func)
@ -1130,12 +1132,16 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en)
sel->obj = ob;
}
}
}
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
{