Fix prevent issues
authorSunyeop Hwang <sunyeop.hwang@samsung.com>
Wed, 9 Jan 2013 13:54:16 +0000 (22:54 +0900)
committerSunyeop Hwang <sunyeop.hwang@samsung.com>
Thu, 10 Jan 2013 05:39:35 +0000 (14:39 +0900)
Change-Id: I40e8f5bfe244f6b1c8f1e323afad90067065029d

26 files changed:
setting-about/src/setting-about-main.c
setting-about/src/setting-about.c
setting-common/include/setting-common-data-slp-setting.h
setting-common/src/setting-cfg.c
setting-common/src/setting-common-data-slp-setting.c
setting-common/src/setting-common-draw-naviframe.c
setting-common/src/setting-common-general-func.c
setting-display/src/setting-display-brightness.c
setting-display/src/setting-display-wallpaper.c
setting-fileview/src/setting-fileview-main.c
setting-font/src/setting-font-main.c
setting-memory/src/setting-memory-status.c
setting-menuscreen/src/setting-menuscreen-main.c
setting-network/src/setting-network-connection-create.c
setting-network/src/setting-network-preferred-network-list.c
setting-password/src/setting-password-main.c
setting-password/src/setting-password.c
setting-powersaving/src/setting-powersaving-brightness.c
setting-powersaving/src/setting-powersaving-main.c
setting-profile/src/setting-profile-sound-main.c
setting-profile/src/setting-profile.c
setting-reset/src/setting-reset-settings.c
setting-storage/src/setting-storage-main.c
setting-time/src/setting-time-main.c
src/setting-main.c
src/setting-plugin.c

index aca35bb..066eb68 100755 (executable)
@@ -714,8 +714,8 @@ int setting_about_generate_genlist(void *data)
                } else {
                                SETTING_TRACE_ERROR("ad->item_dev_name is NULL");
                }
-               FREE(pa_sub_desc);
        }
+       FREE(pa_sub_desc);
 
        // [UI] My number
        int err;
index e5d3b47..d8c5b31 100755 (executable)
@@ -522,7 +522,7 @@ void setting_about_main_exp_cb(void *data, Evas_Object *obj, void *event_info)
        Setting_GenGroupItem_Data *item_data = NULL;
 
        for(; i < ad->my_numbers.count; i++) {
-               if (ad->my_numbers.list[i].num == NULL) {
+               if (ad->my_numbers.list[i].num[0] == '\0') {
                        break;
                }
 
index 3173686..fb93e07 100755 (executable)
@@ -195,11 +195,6 @@ typedef enum {
        BOOL_SLP_SETTING_ACCESSIBILITY_ACCEPT_CALL,
        BOOL_SLP_SETTING_ACCESSIBILITY_POWERKEY_END_CALLS,
 
-       // data usage
-       BOOL_SLP_SETTING_DATAUSAGE_MOBILE_DATA_BOOL,
-       BOOL_SLP_SETTING_DATAUSAGE_DISABLE_MOBILE_DATA_AT_LIMIT_BOOL,
-       BOOL_SLP_SETTING_DATAUSAGE_RESTRICT_BG_DATA_BOOL,
-       BOOL_SLP_SETTING_DATAUSAGE_SHOW_WIFI_USAGE_BOOL,
        /* end */
        SETTING_BOOL_SLP_LIST_MAX
 } setting_bool_slp_list;
index 5922723..e601d9d 100755 (executable)
@@ -675,9 +675,12 @@ bool is_ug_installed_by_ug_args(void *data)
                        SETTING_TRACE_ERROR(" libug-%s.so is *NOT* present, so skip it..\n", ug_name);
                        //return FALSE;
                        is_installed_in_usr = false;
+               } else {
+                       is_installed_in_usr = true;
                }
+       } else {
+               is_installed_in_usr = true;
        }
-       is_installed_in_usr = true;
 
        //2.first do exist-checking in /opt/ug/lib
        //char ug_file[PATH_MAX + 1];
@@ -694,11 +697,15 @@ bool is_ug_installed_by_ug_args(void *data)
                        SETTING_TRACE_ERROR(" libug-%s.so is *NOT* present, so skip it..\n", ug_name);
                        //return FALSE;
                        is_installed_in_opt = false;
+               } else {
+                       is_installed_in_opt = true;
                }
+       } else {
+               is_installed_in_opt = true;
        }
-       is_installed_in_opt = true;
 
-       return (is_installed_in_opt || is_installed_in_opt);
+       FREE(ug_name);
+       return (is_installed_in_usr || is_installed_in_opt);
 }
 
 /*other relative function*/
index 5f5a699..43ffbea 100755 (executable)
@@ -209,12 +209,9 @@ static VconfNode g_btable[] = {
                {BOOL_SLP_SETTING_ACCESSIBILITY_ACCEPT_CALL, VCONFKEY_CISSAPPL_ANSWERING_KEY_BOOL, eBOOL,{0}, export_default, import_default},
                {BOOL_SLP_SETTING_ACCESSIBILITY_POWERKEY_END_CALLS, VCONFKEY_CISSAPPL_POWER_KEY_ENDS_CALL_BOOL, eBOOL,{0}, export_default, import_default},
 
-               //datausage
-               //{BOOL_SLP_SETTING_DATAUSAGE_SET_DATA_USAGE_LIMIT_BOOL, VCONFKEY_SETAPPL_SET_DATA_USAGE_LIMIT_BOOL, eBOOL, {0}, export_default, import_default},
-
                //------------------------------------------------------------------------------------------------
                {SETTING_BOOL_SLP_LIST_MAX, NULL, eBOOL, {0}, export_default, import_default},
-       };
+};
 
 
 /** int vconf table */
@@ -1023,6 +1020,8 @@ bool setting_add_listen_node(Eina_List **listened_list,const char *vconf, vconf_
                        ret = FALSE;
                }
        }
+
+       FREE(node);
        return ret;
 }
 
index 0bfac2e..37cc874 100755 (executable)
@@ -169,7 +169,7 @@ Elm_Object_Item *__create_navi_bar_bottom_buttons(char *title_str, char *lbutton
                if (lbutton_str)
                {
                        lbtn = setting_create_button(navigate_bar, lbutton_str, NAVI_DEF_BUTTON_STYLE, lbutton_click_cb, cb_data);
-                       elm_object_item_part_content_set(navi_it, has_btn_flag ? "toolbar_button2" : "toolbar_button1", lbtn);
+                       elm_object_item_part_content_set(navi_it, "toolbar_button1", lbtn);
                        has_btn_flag = TRUE;
                }
                if (mbutton_str)
@@ -397,7 +397,7 @@ Elm_Object_Item *__push_navi_bar_bottom_buttons(char *title_str,
                        if (lbutton_str)
                        {
                                lbtn = setting_create_button(navigate_bar, lbutton_str, NAVI_DEF_BUTTON_STYLE, lbutton_click_cb, cb_data);
-                               elm_object_item_part_content_set(navi_it, has_btn_flag ? "toolbar_button2" : "toolbar_button1", lbtn);
+                               elm_object_item_part_content_set(navi_it, "toolbar_button1", lbtn);
                                has_btn_flag = TRUE;
                        }
                        if (mbutton_str)
index 3327aab..58e643b 100755 (executable)
@@ -405,9 +405,6 @@ char *get_pa_select_network()
                        //counting.
                        int i = 0;
                        if (state & VCONFKEY_TELEPHONY_DISP_SPN) {
-                               if( i != 0)
-                                       g_strlcat(name, " - ", MAX_COMMON_BUFFER_LEN);
-
                                kv = vconf_get_str(VCONFKEY_TELEPHONY_SPN_NAME);
                                g_strlcat(name, kv, MAX_COMMON_BUFFER_LEN);
                                FREE(kv);
@@ -1567,7 +1564,7 @@ void set_defaultLangICU()
        char *pa_region = vconf_get_str(VCONFKEY_LANGSET);
        char* pa_sub = substring(pa_region, 0, 4);
        SETTING_TRACE(" main - region set from ug result : %s", pa_sub);
-       int err;
+       int err = -1;
        uloc_setDefault(pa_region, &err);
        SETTING_TRACE("errorcode %d ", err);
        FREE(pa_region);
index 6eb6aea..22eb50c 100755 (executable)
@@ -382,10 +382,11 @@ static void __toggle_automatic_chk(void* data, int chk_status)
                        // 2. call brightness set API
                        int value = SETTING_BRIGHTNESS_LEVEL5;
                        //device_get_brightness(BRIGHTNESS_DISPLAY, &value);
-                       if (ad->data_br_sli)
+                       if (ad->data_br_sli) {
                                value = elm_slider_value_get(ad->data_br_sli->eo_check);
-                       SETTING_TRACE(" value of ad->data_br_sli->eo_check: %d ", value);
-                       setting_enable_genlist_item(ad->data_br_sli->item);
+                               SETTING_TRACE(" value of ad->data_br_sli->eo_check: %d ", value);
+                               setting_enable_genlist_item(ad->data_br_sli->item);
+                       }
 
                        ret = setting_set_int_slp_key(INT_SLP_SETTING_LCD_BRIGHTNESS, value, &err);
                        if (0 != ret) //add error handle,due to different target env..
@@ -403,9 +404,11 @@ static void __toggle_automatic_chk(void* data, int chk_status)
                #else
                int value = SETTING_BRIGHTNESS_LEVEL5;
                //device_get_brightness(BRIGHTNESS_DISPLAY, &value);
-               if (ad->data_br_sli) value = elm_slider_value_get(ad->data_br_sli->eo_check);
-               SETTING_TRACE(" value of ad->data_br_sli->eo_check: %d ", value);
-               setting_enable_genlist_item(ad->data_br_sli->item);
+               if (ad->data_br_sli) {
+                       value = elm_slider_value_get(ad->data_br_sli->eo_check);
+                       SETTING_TRACE(" value of ad->data_br_sli->eo_check: %d ", value);
+                       setting_enable_genlist_item(ad->data_br_sli->item);
+               }
                ret = setting_set_int_slp_key(INT_SLP_SETTING_LCD_BRIGHTNESS, value, &err);
                if (0 != ret) //add error handle,due to different target env..
                {
@@ -494,7 +497,8 @@ static Eina_Bool __set_brightness_on_idle(void *data)
        if (!ad || !ad->data_br_sli || !ad->data_br_sli->eo_check)
        {
                SETTING_TRACE_ERROR("!ad || !ad->data_br_sli || !ad->data_br_sli->eo_check");
-               ad->set_idler = NULL;
+               if (ad) 
+                       ad->set_idler = NULL;
                return FALSE;
        }
        //Get the current real value of slider
index eb3abd0..df03f38 100755 (executable)
@@ -235,7 +235,10 @@ static void __setting_display_wallpaper_gallery_ug_result_cb(ui_gadget_h ug, ser
                }
 
                struct ug_cbs *cbs = (struct ug_cbs *)calloc(1, sizeof(struct ug_cbs));
-               setting_retm_if(cbs == NULL, "calloc failed");
+               if (!cbs) {
+                       service_destroy(service);
+                       return;
+               }
 
                cbs->layout_cb = setting_display_layout_ug_cb;
                cbs->result_cb = __setting_display_wallpaper_imageviewer_ug_result_cb;
index 77cfb0d..89d7429 100755 (executable)
@@ -111,6 +111,7 @@ static int setting_fileview_create(void *cb)
        }
 
        setting_view_fileview_main.is_create = 1;
+       service_destroy(svc);
 
        return SETTING_RETURN_SUCCESS;
 }
index ac6d423..655d625 100755 (executable)
@@ -544,13 +544,14 @@ static void __setting_font_main_click_softkey_back_cb(void *data, Evas_Object *o
        else if (ad->viewmode == FONT_SIZE_VIEW_APPCONTROL)
        {
                service_h svc;
-               if (service_create(&svc))
-                       return;
 
                int err;
                int ret = setting_set_int_slp_key(INT_SLP_SETTING_ACCESSIBILITY_FONT_SIZE, ad->ret_font_size, &err);
                setting_retm_if(ret == -1, "Failed to set vconf");
 
+               if (service_create(&svc))
+                       return;
+
                char font_size[SETTING_FONT_MAX_LEN] = {0,};
                snprintf(font_size, SETTING_FONT_MAX_LEN, "%d", ad->ret_font_size);
 
index 5d368bc..ec2fde1 100755 (executable)
@@ -851,7 +851,7 @@ static int __setting_memory_status_mmc_content_init(void *data, setting_memory_m
        setting_retvm_if(NULL == cb, SETTING_RETURN_FAIL, "cb is NULL");
        SettingMemoryUG *ad = (SettingMemoryUG *)data;
        if (ad->mmc_content == NULL) {
-               ad->mmc_content = (struct mmc_contents *)calloc(1, sizeof(struct mmc_contents *));
+               ad->mmc_content = (struct mmc_contents *)calloc(1, sizeof(struct mmc_contents));
                if (ad->mmc_content == NULL ) {
                        SETTING_TRACE_ERROR("calloc failed");
                        return SETTING_RETURN_FAIL;
index cca2777..982f50e 100755 (executable)
@@ -196,7 +196,8 @@ static void _get_menuscreen_info2(/*[OUT]*/int* pkglist_cnt, void* data)
 
     ret = ail_filter_add_str(filter, AIL_PROP_CATEGORIES_STR, "home-screen");
     if (ret != AIL_ERROR_OK) {
-        return ;
+           ail_filter_destroy(filter);
+           return ;
     }
 
     ail_filter_list_appinfo_foreach(filter, appinfo_menuscreen_func, (void *)ugd);
index b41aa4a..c289f76 100755 (executable)
@@ -245,6 +245,7 @@ void __get_connection_info(void *cb)
        int err = connection_get_profile_iterator(ad->connection, CONNECTION_ITERATOR_TYPE_REGISTERED, &profile_iter);
        if (err != CONNECTION_ERROR_NONE) {
                SETTING_TRACE_ERROR("Fail to get profile iterator [%d]", err);
+               FREE(con_name_utf8);
                return;
        }
 
@@ -870,6 +871,7 @@ static int __save_connection(void *data)
                        connection_profile_set_cellular_home_url(con_info, URL_HEAD);
                } else {
                        if (!safeStrCmp(home, "")) {
+                               FREE(home);
                                home = strdup(URL_HEAD);
                                ret = SETTING_DNET_RETURN_NULL_HOMEURL;
                        }
index 84819b5..477f861 100755 (executable)
@@ -203,7 +203,7 @@ static Eina_Bool __genlist_update(void *data)
                                                       network_table[i]);
 
                if ('\0' == ad->search_text[0]
-                   || (one_item->name && is_substr_ncase(one_item->name, ad->search_text))) {  /*  is substring */
+                   || ('\0' == one_item->name[0] && is_substr_ncase(one_item->name, ad->search_text))) {       /*  is substring */
                        /* SETTING_TRACE("Adding item[%s]", one_item->name); */
                        /* SETTING_TRACE("ad->gl_network:%p", ad->gl_network); */
                        gl_item =
index ca3ea3e..0276c6a 100755 (executable)
@@ -58,10 +58,10 @@ __password_main_gl_mouse_up(void *data, Evas *e, Evas_Object *obj,
                setting_hide_input_pannel_cb(ad->ed_pw1->eo_check);
        }
        if (ad->ed_pw2) {
-               setting_hide_input_pannel_cb(ad->ed_pw1->eo_check);
+               setting_hide_input_pannel_cb(ad->ed_pw2->eo_check);
        }
        if (ad->ed_pw3) {
-               setting_hide_input_pannel_cb(ad->ed_pw1->eo_check);
+               setting_hide_input_pannel_cb(ad->ed_pw3->eo_check);
        }
 
 }
@@ -1024,8 +1024,6 @@ setting_password_main_click_softkey_done_cb(void *data, Evas_Object *obj,
 
        SettingPasswordUG *ad = (SettingPasswordUG *) data;
        service_h svc;
-       if (service_create(&svc))
-               return;
 
        SETTING_TRACE("ad->view_type:%d", ad->view_type);
 
@@ -1500,12 +1498,4 @@ setting_password_main_click_softkey_done_cb(void *data, Evas_Object *obj,
                default:
                        return;
        }
-
-       service_add_extra_data(svc, "result", ad->view_type_string);
-       ug_send_result(ad->ug, svc);
-       SETTING_TRACE("Send Result : %s\n", ad->view_type_string);
-
-       service_destroy(svc);
-       /* Send destroy request */
-       ug_destroy_me(ad->ug);
 }
index 04b1946..071548b 100755 (executable)
@@ -778,6 +778,7 @@ static void setting_password_ug_display_result_popup(tapi_receive_info *result,
                                setting_password_ug_create_popup_notitle_nobtn(ad, tmp_str, TRUE);
                        }
                }
+               break;
        case SIM_PIN1_CHANGE_FAIL:
        case SIM_PIN2_CHANGE_FAIL:
                setting_password_ug_create_popup_notitle_nobtn(ad,
index 6df4996..ab14d43 100755 (executable)
@@ -121,7 +121,7 @@ static int setting_powersaving_brightness_create(void *cb)
                SETTING_TRACE_ERROR("ad->data_br_sli is NULL");
        }
 
-       if (auto_value) {
+       if (auto_value && ad->data_br_sli) {
                setting_disable_genlist_item(ad->data_br_sli->item);
        }
 
index 86a4367..bf01dbd 100755 (executable)
@@ -447,47 +447,46 @@ __powersaving_on_resp_cb(void *data, Evas_Object *obj, void *event_info)
        int response_type = btn_type(obj);
        SettingPowersavingUG *ad = (SettingPowersavingUG *) data;
        if (POPUP_RESPONSE_OK == response_type) {       //need set vconf
-               int err =
-                   vconf_set_bool(VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS,
-                                  ad->data_powersaving_active->chk_status);
-               if (0 != err) { //if set failed, need rollback
-                       SETTING_TRACE_ERROR("Set vconf Failed");
-                       if (ad->data_powersaving_active) {
+               if (ad->data_powersaving_active) {
+                       int err =
+                               vconf_set_bool(VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS,
+                                               ad->data_powersaving_active->chk_status);
+                       if (0 != err) { //if set failed, need rollback
+                               SETTING_TRACE_ERROR("Set vconf Failed");
                                ad->data_powersaving_active->chk_status =
-                                   !ad->data_powersaving_active->chk_status;
+                                       !ad->data_powersaving_active->chk_status;
                                elm_check_state_set(ad->
-                                                   data_powersaving_active->
-                                                   eo_check,
-                                                   ad->
-                                                   data_powersaving_active->
-                                                   chk_status);
+                                               data_powersaving_active->
+                                               eo_check,
+                                               ad->
+                                               data_powersaving_active->
+                                               chk_status);
+                               return;
                        }
-                       return;
-               }
-               if (ad->data_powersaving_active->chk_status) {//powersaving is on
-                       int pwrsv_vib = 0;
-                       vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_SCREEN_VIB, &pwrsv_vib);
-                       if (pwrsv_vib){
+                       if (ad->data_powersaving_active->chk_status) {//powersaving is on
+                               int pwrsv_vib = 0;
+                               vconf_get_bool(VCONFKEY_SETAPPL_PWRSV_CUSTMODE_SCREEN_VIB, &pwrsv_vib);
+                               if (pwrsv_vib){
+                                       //touch feedback virbration
+                                       int value = 0;
+                                       vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &value);
+                                       vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_BAK_INT, value);//backup
+                                       vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, 0);
+                               }
+                       } else {//powersaving is off
                                //touch feedback virbration
                                int value = 0;
-                               vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, &value);
-                               vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_BAK_INT, value);//backup
-                               vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, 0);
+                               vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_BAK_INT, &value);
+                               vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, value);
                        }
-               } else {//powersaving is off
-                       //touch feedback virbration
-                       int value = 0;
-                       vconf_get_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_BAK_INT, &value);
-                       vconf_set_int(VCONFKEY_SETAPPL_TOUCH_FEEDBACK_VIBRATION_LEVEL_INT, value);
-               }
 
-               if (ad->popup_chk && elm_check_state_get(ad->popup_chk)) {
-                       (void)
-                           vconf_set_bool
-                           (VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS_REMINDER,
-                            FALSE);
+                       if (ad->popup_chk && elm_check_state_get(ad->popup_chk)) {
+                               (void)
+                                       vconf_set_bool
+                                       (VCONFKEY_SETAPPL_PWRSV_SYSMODE_STATUS_REMINDER,
+                                        FALSE);
+                       }
                }
-
        } else if (POPUP_RESPONSE_CANCEL == response_type) {    //need rollback
                if (ad->data_powersaving_active) {
                        ad->data_powersaving_active->chk_status =
index 0d68b54..63b0dbc 100755 (executable)
@@ -437,7 +437,10 @@ void __volume_stop_change_cb(void *data, Evas_Object *obj, void *event_info)
                return;
        }
 
-       FREE(pa_tone_path);
+       if(pa_tone_path) {
+               free(pa_tone_path);
+               pa_tone_path = NULL;
+       }
 
        SETTING_TRACE_END;
 }
@@ -1291,8 +1294,10 @@ static void setting_profile_sound_main_create_myfile_ug(SettingProfileUG *ad)
        FREE(cbs);
 
        /** @todo verify it's valid */
-       if(pa_cur_ringtone)
-               FREE(pa_cur_ringtone);
+       if(pa_cur_ringtone) {
+               free(pa_cur_ringtone);
+               pa_cur_ringtone = NULL;
+       }
 
        __setting_profile_ug_key_ungrab(ad);
        return;
index bb66fad..1848193 100755 (executable)
@@ -290,7 +290,7 @@ static void setting_profile_vconf_change_cb(keynode_t *key, void *data)
        else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_NOTI_MSG_ALERT_REP_TYPE_INT)) {
                status = vconf_keynode_get_int(key);
 
-               if(ad->data_msg_alert_repeat)
+               if(status >= 0 && ad->data_msg_alert_repeat)
                {
                        ad->data_msg_alert_repeat->sub_desc = (char*)g_strdup(_(repeat_type[status]));
                        elm_genlist_item_update(ad->data_msg_alert_repeat->item);
@@ -318,7 +318,7 @@ static void setting_profile_vconf_change_cb(keynode_t *key, void *data)
        else if (!safeStrCmp(vconf_name, VCONFKEY_SETAPPL_NOTI_EMAIL_ALERT_REP_TYPE_INT)) {
                status = vconf_keynode_get_int(key);
 
-               if(ad->data_email_alert_repeat)
+               if(status >= 0 && ad->data_email_alert_repeat)
                {
                        ad->data_email_alert_repeat->sub_desc = (char*)g_strdup(_(repeat_type[status]));
                        elm_genlist_item_update(ad->data_email_alert_repeat->item);
@@ -544,7 +544,10 @@ static void setting_profile_ug_on_resume(ui_gadget_h ug, service_h service, void
                        profileUG->data_call_alert_tone->sub_desc = setting_file_basename(pa_tone_path);
                        elm_genlist_item_update(profileUG->data_call_alert_tone->item);
                }
-               FREE(pa_tone_path);
+               if (pa_tone_path) {
+                       free(pa_tone_path);
+                       pa_tone_path = NULL;
+               }
        }
 
        /* 2. message ringtone */
@@ -561,7 +564,10 @@ static void setting_profile_ug_on_resume(ui_gadget_h ug, service_h service, void
                        profileUG->data_msg_alert_tone->sub_desc = setting_file_basename(pa_tone_path);
                        elm_genlist_item_update(profileUG->data_msg_alert_tone->item);
                }
-               FREE(pa_tone_path);
+               if (pa_tone_path) {
+                       free(pa_tone_path);
+                       pa_tone_path = NULL;
+               }
        }
 
        /* 3. email ringtone */
@@ -577,7 +583,10 @@ static void setting_profile_ug_on_resume(ui_gadget_h ug, service_h service, void
                        profileUG->data_email_alert_tone->sub_desc = setting_file_basename(pa_tone_path);
                        elm_genlist_item_update(profileUG->data_email_alert_tone->item);
                }
-               FREE(pa_tone_path);
+               if (pa_tone_path) {
+                       free(pa_tone_path);
+                       pa_tone_path = NULL;
+               }
        }
 }
 
index 2dedb3a..d4e8ab5 100755 (executable)
@@ -506,6 +506,9 @@ static void __reset_an_item(Setting_Done_List_Data *list_data,
                                                         (char *)item_name,
                                                         (char *)result_str, NULL);
                        ecore_idler_add((Ecore_Task_Cb) __delay_reset_location, item_data);
+
+                       service_destroy(svc);
+                       FREE(path);
                        return;
                }
 
index f0a3956..f9b83e5 100755 (executable)
@@ -627,7 +627,7 @@ static int __setting_storage_main_mmc_content_init(void *data, setting_storage_m
        setting_retvm_if(NULL == cb, SETTING_RETURN_FAIL, "cb is NULL");
        SettingStorageUG *ad = (SettingStorageUG *)data;
        if (ad->mmc_content == NULL) {
-               ad->mmc_content = (struct mmc_contents *)calloc(1, sizeof(struct mmc_contents *));
+               ad->mmc_content = (struct mmc_contents *)calloc(1, sizeof(struct mmc_contents));
                if (ad->mmc_content == NULL ) {
                        SETTING_TRACE_ERROR("calloc failed");
                        return SETTING_RETURN_FAIL;
@@ -1414,8 +1414,13 @@ static void __setting_storage_main_init(void *data)
        pthread_mutex_init(&ad->update_mutex, NULL);
        pthread_cond_init(&ad->wait_cond, NULL);
 
+       pthread_mutex_lock(&ad->exit_mutex);
        ad->exit_flag = EINA_FALSE;
+       pthread_mutex_unlock(&ad->exit_mutex);
+
+       pthread_mutex_lock(&ad->update_mutex);
        ad->type = SETTING_STORAGE_PICTURES_VIDEO;
+       pthread_mutex_unlock(&ad->update_mutex);
 
        ad->internal_status.dAvail = 0.0;
        ad->internal_status.dTotal= 0.0;
index a5555fc..06364f2 100755 (executable)
@@ -835,7 +835,7 @@ static int setting_time_main_create(void *cb)
 
                char* timezone_str = get_timezone_str();
 
-               bool ret = get_city_name(timezone_str);
+               ret = get_city_name(timezone_str);
                if (ret) {
                        SETTING_TRACE(">>>>>> RESULT : %s", get_city_name_result());
                }
index 57e933c..dd18412 100755 (executable)
@@ -1222,25 +1222,31 @@ static int get_downloadapp_list(void* data)
        ail_filter_h f;
 
        DrawAppInfo* pinfo = (DrawAppInfo*)malloc(sizeof(DrawAppInfo));
-       pinfo->ncount = 0;
-       pinfo->draw_app = draw_3rdapp;
-       pinfo->data = ad;
 
-       if (ail_filter_new(&f) == AIL_ERROR_OK)
-       {
-               if (ail_filter_add_bool(f, AIL_PROP_NODISPLAY_BOOL, false) != AIL_ERROR_OK)
+       if (pinfo) {
+               pinfo->ncount = 0;
+               pinfo->draw_app = draw_3rdapp;
+               pinfo->data = ad;
+
+               if (ail_filter_new(&f) == AIL_ERROR_OK)
                {
-                       SETTING_TRACE("ail filter error");
-                       return 0;
-               }
+                       if (ail_filter_add_bool(f, AIL_PROP_NODISPLAY_BOOL, false) != AIL_ERROR_OK)
+                       {
+                               SETTING_TRACE("ail filter error");
 
-               ail_filter_list_appinfo_foreach(f, __download_apps_cb, pinfo);
-               //---------------------------------------------------------------
-               ail_filter_destroy(f);
-       }
-       ncount = pinfo->ncount;
+                               free(pinfo);
+                               pinfo = NULL;
+
+                               ail_filter_destroy(f);
+                               return 0;
+                       }
+
+                       ail_filter_list_appinfo_foreach(f, __download_apps_cb, pinfo);
+                       //---------------------------------------------------------------
+                       ail_filter_destroy(f);
+               }
+               ncount = pinfo->ncount;
 
-       if (pinfo) {
                free(pinfo);
                pinfo = NULL;
        }
index c92de62..c2fe5fc 100755 (executable)
@@ -117,6 +117,8 @@ static void __drawer_add(const char *type, drawer_fp draw)
 
                _g_drawer_list = eina_list_append(_g_drawer_list, node);
        }
+
+       FREE(node);
 }
 
 
@@ -276,7 +278,11 @@ static DBusHandlerResult __signal_filter(DBusConnection* conn, DBusMessage* mess
                // received key : checkbox1|N/A , value : INT|1
                //-------------------------------------------------------------
                //char* key = "checkbox1|N/A";
-               char* ptr = strchr(key, '|');
+               char* ptr = NULL;
+
+               if (key) {
+                       ptr = strchr(key, '|');
+               }
 
                xmlDocPtr doc = NULL;
                if (ptr && key)
@@ -510,7 +516,7 @@ static void ___click_softkey_back_cb(void *data, Evas_Object *obj,
 static void* group_func(void *data, xmlNode *xmlObj)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(!data || !xmlObj);
+       retv_if(!data || !xmlObj, NULL);
 
        PluginNode* node = (PluginNode*)data;
        Draw_Data *pd = node->pd;
@@ -551,21 +557,21 @@ static void* group_func(void *data, xmlNode *xmlObj)
 static void* __link_list_cb(void *data, Evas_Object *obj, void *event_info)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(data == NULL);
-       retm_if(event_info == NULL, "Invalid argument: event info is NULL");
+       retv_if(data == NULL, NULL);
+       retvm_if(event_info == NULL, NULL, "Invalid argument: event info is NULL");
        Elm_Object_Item *item = (Elm_Object_Item *) event_info;
        elm_genlist_item_selected_set(item, 0);
        Setting_GenGroupItem_Data *list_item =
            (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
 
        xmlNode* xmlObj = data;
-       ret_if(!xmlObj);
+       retv_if(!xmlObj, NULL);
        const char *link_file = (char*)xmlGetProp(xmlObj, "value");
 
        if(!link_file)
        {
                SETTING_TRACE_ERROR("Invalidate liked file");
-               return;
+               return NULL;
        }
        char file[1024] = {0,};
        snprintf(file, sizeof(file), "%s/%s", PLUGIN_CFG_DIR, link_file);
@@ -582,15 +588,15 @@ static void* __link_list_cb(void *data, Evas_Object *obj, void *event_info)
 static void* __launch_list_cb(void *data, Evas_Object *obj, void *event_info)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(data == NULL);
-       retm_if(event_info == NULL, "Invalid argument: event info is NULL");
+       retv_if(data == NULL, NULL);
+       retvm_if(event_info == NULL, NULL, "Invalid argument: event info is NULL");
        Elm_Object_Item *item = (Elm_Object_Item *) event_info;
        elm_genlist_item_selected_set(item, 0);
        Setting_GenGroupItem_Data *list_item =
            (Setting_GenGroupItem_Data *) elm_object_item_data_get(item);
 
        xmlNode* xmlObj = data;
-       ret_if(!xmlObj);
+       retv_if(!xmlObj, NULL);
        const char *key_str = (char*)xmlGetProp(xmlObj, "id");
        const char *title_str = (char*)xmlGetProp(xmlObj, "title");
        const char *appid_str = (char*)xmlGetProp(xmlObj, "appid");
@@ -610,7 +616,7 @@ static void* __launch_list_cb(void *data, Evas_Object *obj, void *event_info)
 static void* label_func(void *data, xmlNode *xmlObj)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(!data || !xmlObj);
+       retv_if(!data || !xmlObj, NULL);
        PluginNode* node = (PluginNode*)data;
        Draw_Data *pd = node->pd;
 
@@ -628,7 +634,7 @@ static void* label_func(void *data, xmlNode *xmlObj)
 static void* link_func(void *data, xmlNode *xmlObj)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(!data || !xmlObj);
+       retv_if(!data || !xmlObj, NULL);
        PluginNode* node = (PluginNode*)data;
        Draw_Data *pd = node->pd;
 
@@ -645,7 +651,7 @@ static void* link_func(void *data, xmlNode *xmlObj)
 static void* launch_func(void *data, xmlNode *xmlObj)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(!data || !xmlObj);
+       retv_if(!data || !xmlObj, NULL);
        PluginNode* node = (PluginNode*)data;
        Draw_Data *pd = node->pd;
 
@@ -692,7 +698,7 @@ static void __slider_stop_cb(void *data, Evas_Object *obj,
 static void* slider_func(void *data, xmlNode *xmlObj)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(!data || !xmlObj);
+       retv_if(!data || !xmlObj, NULL);
        PluginNode* node = (PluginNode*)data;
        Draw_Data *pd = node->pd;
 
@@ -843,7 +849,7 @@ static void __chk_btn_cb(void *data, Evas_Object *obj,
 static void* checkbox_func(void *data, xmlNode *xmlObj)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(!data || !xmlObj);
+       retv_if(!data || !xmlObj, NULL);
 
        PluginNode* node = (PluginNode*)data;
        Draw_Data *pd = node->pd;
@@ -899,7 +905,11 @@ static void __entry_unfocus_cb(void *data, Evas_Object *obj, void *event_info)
        Setting_GenGroupItem_Data *list_item = data;
 
        xmlNode* xmlObj = list_item->userdata;
-       ret_if(!xmlObj);
+       if(!xmlObj) {
+               FREE(entry_str_utf8);
+               return;
+       }
+
        xmlAttrPtr newattr;
        const char *title = (char*)xmlSetProp(xmlObj, "value",entry_str_utf8);
 
@@ -954,7 +964,7 @@ static void __editbox_changed_cb(void *data, Evas_Object *obj,
 static void* editbox_func(void *data, xmlNode *xmlObj)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(!data || !xmlObj);
+       retv_if(!data || !xmlObj, NULL);
 
        PluginNode* node = (PluginNode*)data;
        Draw_Data *pd = node->pd;
@@ -1057,7 +1067,6 @@ static void __expanditem_func_exp_cb(void *data, Evas_Object *obj, void *event_i
        //char *value = (char*)xmlGetProp(xmlObj, "string");
        char *value = (char*)xmlGetProp(xmlObj, "value");
        SETTING_TRACE(">>> value = %s", value);
-       int i=0;
        Evas_Object *rgd = NULL;
 
        if (xmlObj->children && !data_parentItem->rgd) {//to protect from entering repeatly
@@ -1066,7 +1075,6 @@ static void __expanditem_func_exp_cb(void *data, Evas_Object *obj, void *event_i
                rgd = elm_radio_add(scroller);
                elm_radio_value_set(rgd, -1);
 
-               int i;
                char *type;
                char *subitem_title = NULL;
                int subitem_index = 0;
@@ -1097,8 +1105,6 @@ static void __expanditem_func_exp_cb(void *data, Evas_Object *obj, void *event_i
                                } else {
                                        SETTING_TRACE("invalid type[:%s]", type);
                                }
-
-                               i++;
                        }
                        cur = cur->next;
                }
@@ -1178,7 +1184,7 @@ Evas_Object *setting_create_layout_navi_bar2(Evas_Object *win_layout, Evas_Objec
 static void* setting_func(void *data, xmlNode *xmlObj)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(!data || !xmlObj);
+       retv_if(!data || !xmlObj, NULL);
 
 #if 1
        PluginNode* node = (PluginNode*)data;
@@ -1222,7 +1228,7 @@ static void* expanditem_func(void *data, xmlNode *xmlObj)
 static void* expandlist_func(void *data, xmlNode *xmlObj)
 {
        SETTING_TRACE_BEGIN;
-       ret_if(!data || !xmlObj);
+       retv_if(!data || !xmlObj, NULL);
 
        PluginNode* node = (PluginNode*)data;
        Draw_Data *pd = node->pd;
@@ -1448,6 +1454,12 @@ PluginNode* setting_plugin_create()
        PluginNode *node = calloc(1, sizeof(PluginNode));
 
        Draw_Data *pd = calloc(1, sizeof(Draw_Data));
+
+       if (node && !pd) {
+               free(node);
+               node = NULL;
+       }
+
        setting_retvm_if(!pd, -1, "Create Draw_Data obj failed");
        //eina_init();