Fix memory leak issue related to elm_genlist_item_class_new 58/136458/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 30 Jun 2017 01:24:30 +0000 (10:24 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 30 Jun 2017 01:25:28 +0000 (10:25 +0900)
Dynamic memory referenced by 'ttc' was allocated at elm_genlist.c:9006
by calling function 'elm_genlist_item_class_new' at input_method_setting_selector_ui.cpp:464 and
lost at input_method_setting_selector_ui.cpp:467

Change-Id: I843f7cdaafd43196ae78f2f14d2f363fde820863
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
im_setting_list/input_method_setting_list_popup_view.cpp
im_setting_selector/input_method_setting_selector_ui.cpp

index 5b29f76..37f94d6 100644 (file)
@@ -376,10 +376,12 @@ static void im_setting_list_screen_create(void *data)
 {
     appdata *ad = NULL;
     Evas_Object *genlist = NULL;
-    Elm_Genlist_Item_Class *ttc = elm_genlist_item_class_new();
 
     ad = (appdata *) data;
-    if (ad == NULL || !ttc) return;
+    if (ad == NULL) return;
+
+    Elm_Genlist_Item_Class *ttc = elm_genlist_item_class_new();
+    if (!ttc) return;
 
     ttc->item_style = "title";
     ttc->func.text_get = im_setting_list_default_keyboard_title_text_get;
index 6ec7561..e0af4c9 100644 (file)
@@ -446,10 +446,12 @@ static void im_setting_selector_screen_create(void *data)
 {
     appdata *ad = NULL;
     Evas_Object *genlist = NULL;
-    Elm_Genlist_Item_Class *ttc = elm_genlist_item_class_new();
 
     ad = (appdata *) data;
-    if (ad == NULL || !ttc) return;
+    if (ad == NULL) return;
+
+    Elm_Genlist_Item_Class *ttc = elm_genlist_item_class_new();
+    if (!ttc) return;
 
     ttc->item_style = "title";
     ttc->func.text_get = im_setting_selector_title_text_get;