[PACKAGE UPLOAD] 0.0.47
authorEunmi Son <eunmi.son@samsung.com>
Tue, 8 Jan 2013 15:46:21 +0000 (00:46 +0900)
committerEunmi Son <eunmi.son@samsung.com>
Tue, 8 Jan 2013 15:46:21 +0000 (00:46 +0900)
Fix memory leak

Change-Id: Ieba35b82f088ab06c5202ea5cc84c648475c0109

common/src/mgr-app-common-util.c
packaging/ug-setting-manage-applications-efl.spec
view/src/mgr-app-view-app-info.c
view/src/mgr-app-view-app-list.c

index ab58dea..f35c891 100755 (executable)
@@ -61,7 +61,7 @@ void _strupr(char *str)
 {
        int i = 0;
 
-       if (!str && strlen(str) <= 0) {
+       if (!str || strlen(str) <= 0) {
                MGR_APP_DEBUG_ERR("STRUPR ERROR string is null");
                return;
        }
index 67c7135..8692a2f 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:          ug-setting-manage-applications-efl
 Summary:       Manage Application package
-Version:       0.0.46
+Version:       0.0.47
 Release:       0
 Group:         Applications/System
 License:       Flora Software License
index 1480edd..757d5fe 100755 (executable)
@@ -444,7 +444,6 @@ static void _layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv)
        MGR_APP_BEGIN();
 
        Evas_Object *base       = NULL;
-       Evas_Object *win        = NULL;
 
        if (!priv) {
                MGR_APP_END();
@@ -457,8 +456,6 @@ static void _layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv)
                return;
        }
 
-       win = ug_get_window();
-
        switch (mode) {
        case UG_MODE_FULLVIEW:
                evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -974,13 +971,11 @@ static Evas_Object *__create_genlist_app_info(Evas_Object *parent, void *data)
 
        Elm_Object_Item *item_app                       = NULL;
        Elm_Object_Item *item_life                      = NULL;
-       Elm_Object_Item *item_sto_title         = NULL;
        Elm_Object_Item *item_sto_total = NULL;
        Elm_Object_Item *item_sto_app           = NULL;
        Elm_Object_Item *item_sto_data          = NULL;
        Elm_Object_Item *item_data                      = NULL;
        Elm_Object_Item *item_launch_text       = NULL;
-       Elm_Object_Item *item_launch_title      = NULL;
        Elm_Object_Item *item_launch            = NULL;
        Elm_Object_Item *item_sep               = NULL;
        Elm_Object_Item *item_detail            = NULL;
@@ -1145,7 +1140,7 @@ static Evas_Object *__create_genlist_app_info(Evas_Object *parent, void *data)
                elm_genlist_item_select_mode_set(item_life, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
 
        /* Storage */
-       item_sto_title = elm_genlist_item_append(genlist, itc_sto_title, sto_title, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
+       elm_genlist_item_append(genlist, itc_sto_title, sto_title, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
        item_sto_total = elm_genlist_item_append(genlist, itc_sto_total, ELM_STATE_TOP, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
        if (item_sto_total)
                elm_genlist_item_select_mode_set(item_sto_total, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
@@ -1176,7 +1171,7 @@ static Evas_Object *__create_genlist_app_info(Evas_Object *parent, void *data)
 #endif
 
        /* Launch */
-       item_launch_title = elm_genlist_item_append(genlist, itc_launch_title, launch_title, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
+       elm_genlist_item_append(genlist, itc_launch_title, launch_title, NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
        item_launch = elm_genlist_item_append(genlist, itc_launch, ELM_STATE_DEFAULT, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel_launch, (void*)ugd);
        if (item_launch && !appsvc_is_defapp(app_info->pkg_name)) {
                elm_genlist_item_selected_set(item_launch, EINA_FALSE);
index 8b297e9..76e0d59 100755 (executable)
@@ -315,7 +315,7 @@ static ail_cb_ret_e _appinfo_func_cb(const ail_appinfo_h ail_info, void *user_da
                return AIL_CB_RET_CONTINUE;
        }
        if (p_app_info_list->pkg_name && !strstr(package_name, p_app_info_list->pkg_name)) {
-               return;
+               return AIL_CB_RET_CONTINUE;
        }
        ail_appinfo_get_str(ail_info, AIL_PROP_NAME_STR, &app_name);
        if (!app_name) {
@@ -499,6 +499,7 @@ static void _list_update_by_install(char *pkg_type, const char *pkg_name, void *
                                        mgr_app_app_info_t *app_info_prev = elm_object_item_data_get(prev_item);
                                        if (!app_info_prev) {
                                                MGR_APP_MEM_FREE(letter);
+                                               MGR_APP_MEM_FREE(letter_new);
                                                return;
                                        }
 
@@ -538,7 +539,10 @@ static void _list_update_by_install(char *pkg_type, const char *pkg_name, void *
                                /* check the item and append after last item */
                                if (item == elm_genlist_last_item_get(app_list_view_data->genlist)) {
                                        char *letter_new = __convert_char_to_string(app_info_new->app_name[0]);
-                                       ret_if(letter_new == NULL);
+                                       if (!letter_new) {
+                                               MGR_APP_MEM_FREE(app_info_new);
+                                               return;
+                                       }
 
                                        Elm_Object_Item *new_item = elm_genlist_item_append(app_list_view_data->genlist, itc, (void*)app_info_new, NULL, ELM_GENLIST_ITEM_NONE, _gl_sel, (void*)ugd);
                                        ret_if(new_item == NULL);
@@ -826,7 +830,10 @@ static void _index_del_item_cb(void *data, Evas_Object *obj, void *event_info)
                Elm_Object_Item *index_item = (Elm_Object_Item*)event_info;
 
                const char *letter = elm_index_item_letter_get(index_item);
-               ret_if(letter == NULL);
+               if (!letter) {
+                       MGR_APP_MEM_FREE(next_letter);
+                       return;
+               }
 
                Elm_Object_Item *prev_item = elm_genlist_item_prev_get(item);