summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-24 18:21:07 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-24 18:44:15 +0900
commit35e39f4145420d8b2d14f93e91633cfceffe4540 (patch)
tree666c8d57374992550bc0e0c8032c0a637c32c3cf
parent10f7641dda4575a4236cbc45e70afa7bf4758e3e (diff)
edje entry - fix coverity CID 1357752
fix potential crash if calloc fails and sel is NULL @fix
-rw-r--r--src/lib/edje/edje_entry.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index bfb77d15aa..cb9f732bc0 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -1122,19 +1122,25 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en)
1122 Evas_Object *ob; 1122 Evas_Object *ob;
1123 1123
1124 sel = calloc(1, sizeof(Sel)); 1124 sel = calloc(1, sizeof(Sel));
1125 an->sel = eina_list_append(an->sel, sel); 1125 if (sel)
1126
1127 if (ed->item_provider.func)
1128 { 1126 {
1129 ob = _item_obj_get(an, o, smart, clip); 1127 an->sel = eina_list_append(an->sel, sel);
1130 sel->obj = ob; 1128
1129 if (ed->item_provider.func)
1130 {
1131 ob = _item_obj_get(an, o, smart, clip);
1132 sel->obj = ob;
1133 }
1131 } 1134 }
1132 } 1135 }
1133 /* We have only one sel per item */ 1136 if (sel)
1134 sel = an->sel->data; 1137 {
1135 evas_object_move(sel->obj, x + cx, y + cy); 1138 /* We have only one sel per item */
1136 evas_object_resize(sel->obj, cw, ch); 1139 sel = an->sel->data;
1137 evas_object_show(sel->obj); 1140 evas_object_move(sel->obj, x + cx, y + cy);
1141 evas_object_resize(sel->obj, cw, ch);
1142 evas_object_show(sel->obj);
1143 }
1138 } 1144 }
1139 // for link anchors 1145 // for link anchors
1140 else 1146 else