edje_edit : add null check and close eet
authorJunsuChoi <jsuya.choi@samsung.com>
Tue, 20 Sep 2016 14:34:17 +0000 (23:34 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Wed, 21 Sep 2016 00:42:46 +0000 (09:42 +0900)
Signed-off-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
src/lib/edje/edje_edit.c

index f3381fa..65e490c 100644 (file)
@@ -1675,6 +1675,11 @@ 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);
+   if (!epc)
+     {
+        eet_close(eetf);
+        return EINA_FALSE;
+     }
 
    /* Search first free id */
    id = -1;
@@ -1703,7 +1708,11 @@ 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)
+     {
+        eet_close(eetf);
+        return EINA_FALSE;
+     }
 
    /* Init Edje_Part_Collection_Directory_Entry */
    de->id = id;