[CnP] Fix prevent of null dereference
authorThiep Ha <thiep.ha@samsung.com>
Thu, 27 Jun 2013 11:42:04 +0000 (20:42 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Fri, 28 Jun 2013 10:51:52 +0000 (19:51 +0900)
Change-Id: I97f25026f042a63b439304fb4a3e4185b543c9b4

src/lib/elm_cnp.c

index 36099a7..ab2749b 100644 (file)
@@ -2879,10 +2879,13 @@ elm_drop_item_container_add(Evas_Object *obj,
    if (elm_drop_item_container_del_internal(obj, EINA_FALSE))
      {  /* Updating info of existing obj */
         st = eina_list_search_unsorted(cont_drop_tg, _drop_item_container_cmp, obj);
+        if (!st) return EINA_FALSE;
      }
    else
      {
         st = calloc(1, sizeof(*st));
+        if (!st) return EINA_FALSE;
+
         st->obj = obj;
         cont_drop_tg = eina_list_append(cont_drop_tg, st);
      }
@@ -3224,10 +3227,13 @@ elm_drag_item_container_add(
    if (elm_drag_item_container_del_internal(obj, EINA_FALSE))
      {  /* Updating info of existing obj */
         st = eina_list_search_unsorted(cont_drag_tg, _drag_item_container_cmp, obj);
+        if (!st) return EINA_FALSE;
      }
    else
      {
         st = calloc(1, sizeof(*st));
+        if (!st) return EINA_FALSE;
+
         st->obj = obj;
         cont_drag_tg = eina_list_append(cont_drag_tg, st);