edje_edit : add null check and close eet 08/88808/4
authorJunsuChoi <jsuya.choi@samsung.com>
Tue, 20 Sep 2016 14:34:17 +0000 (23:34 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 20 Sep 2016 14:48:19 +0000 (07:48 -0700)
Change-Id: I9292bfc0e830f84a0828b1ec6352701f52d6c8f5

src/lib/edje/edje_edit.c

index 475e9f0..8058107 100644 (file)
@@ -1657,6 +1657,13 @@ edje_edit_group_copy(Evas_Object *obj, const char *group_name, const char *copy_
      }
    snprintf(buf, sizeof(buf), "edje/collections/%d", e->id);
    epc = eet_data_read(eetf, _edje_edd_edje_part_collection, buf);
+   // TIZEN_ONLY(20160920): add null check and close eet
+   if (!epc)
+     {
+        eet_close(eetf);
+        return EINA_FALSE;
+     }
+   //
 
    /* Search first free id */
    id = -1;
@@ -1685,7 +1692,13 @@ edje_edit_group_copy(Evas_Object *obj, const char *group_name, const char *copy_
 
    /* Create structs */
    de = _alloc(sizeof(Edje_Part_Collection_Directory_Entry));
-   if (!de) return EINA_FALSE;
+   if (!de)
+     {
+        // TIZEN_ONLY(20160920): add null check and close eet
+        eet_close(eetf);
+        //
+        return EINA_FALSE;
+     }
 
    /* Init Edje_Part_Collection_Directory_Entry */
    de->id = id;