From: ABHISHEK JAIN Date: Mon, 18 Sep 2017 09:54:07 +0000 (+0530) Subject: [SVACE][TBT_W][Fixed SVACE Issues for TBT Wearble module] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F28%2F150728%2F4;p=test%2Ftct%2Fnative%2Fbehavior.git [SVACE][TBT_W][Fixed SVACE Issues for TBT Wearble module] Signed-off-by: ABHISHEK JAIN Change-Id: Ib105b1f70e0e25408a0c854aea6712d5089d232a --- diff --git a/coretbtuiapp/inc/coretbt_uiapp.h b/coretbtuiapp/inc/coretbt_uiapp.h index 9d06581..115f108 100644 --- a/coretbtuiapp/inc/coretbt_uiapp.h +++ b/coretbtuiapp/inc/coretbt_uiapp.h @@ -89,10 +89,6 @@ static inline device_type_e get_device_type() { device_type = DEVICE_WEARABLE_360_X_480; } - else if(width == 320 && height == 320) - { - device_type = DEVICE_WEARABLE_320_320; - } else { device_type = DEVICE_WEARABLE_320_320; diff --git a/coretbtuiapp/src/coretbt_uiapp.c b/coretbtuiapp/src/coretbt_uiapp.c index 0492cc5..b500d35 100644 --- a/coretbtuiapp/src/coretbt_uiapp.c +++ b/coretbtuiapp/src/coretbt_uiapp.c @@ -110,6 +110,7 @@ Elm_Object_Item* _elm_genlist_item_append(appdata_s *this, char *item_text, void itc->func.del = _gl_del_cb; item_data *id = calloc(sizeof(item_data), 1); + RETVM_IF(id == NULL,NULL,"id is null"); id->index = index++; id->text = strdup(item_text); diff --git a/operationpickviewapp/inc/logger.h b/operationpickviewapp/inc/logger.h index b2f6119..7e6f5ac 100644 --- a/operationpickviewapp/inc/logger.h +++ b/operationpickviewapp/inc/logger.h @@ -52,6 +52,28 @@ } \ } +#define RETM_IF_CLEANUP(expr, fmt, FreeResource, arg...) \ +{ \ + if (expr) \ + { \ + ERR(fmt, ##arg); \ + FreeResource; \ + return; \ + } \ +} + + +#define RETVM_IF_CLEANUP(expr, val, fmt, FreeResource, arg...) \ +{ \ + if (expr) \ + { \ + ERR(fmt, ##arg); \ + FreeResource; \ + return (val); \ + } \ +} + + #define SAFE_DELETE(a) if( (a) != NULL ) free (a); (a) = NULL; #endif /* __LOGGER_H__ */ diff --git a/operationpickviewapp/src/operationpickviewapp.c b/operationpickviewapp/src/operationpickviewapp.c index 21457b3..eedea6c 100644 --- a/operationpickviewapp/src/operationpickviewapp.c +++ b/operationpickviewapp/src/operationpickviewapp.c @@ -642,6 +642,7 @@ static void show_video(void* data) this->video_player_data = (videoplayer_data_s*) malloc(sizeof(videoplayer_data_s)); + RETM_IF( this->video_player_data == NULL,"data pointer is null"); //this->video_player_data->video_rect = this->video_rect; this->video_player_data->bg = NULL; this->video_player_data->rect = NULL; @@ -662,6 +663,8 @@ static void show_audio(void* data) appdata_s *this = (appdata_s*) data; this->sound_player_data = (soundplayer_data_s*) malloc(sizeof(soundplayer_data_s)); + RETM_IF( this->sound_player_data == NULL,"data pointer is null"); + this->sound_player_data->uri = this->uri; this->sound_player_data->player = create_sound_player(this->sound_player_data); diff --git a/release/binary-armv7l/org.tizen.coretbt_dataprovider-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.coretbt_dataprovider-1.0.0-arm.tpk old mode 100755 new mode 100644 index dfad22f..a7d6749 Binary files a/release/binary-armv7l/org.tizen.coretbt_dataprovider-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.coretbt_dataprovider-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.coretbt_serviceapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.coretbt_serviceapp-1.0.0-arm.tpk old mode 100755 new mode 100644 index 85b1652..f801c06 Binary files a/release/binary-armv7l/org.tizen.coretbt_serviceapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.coretbt_serviceapp-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.coretbt_uiapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.coretbt_uiapp-1.0.0-arm.tpk index 0acb5d1..bf16cf9 100755 Binary files a/release/binary-armv7l/org.tizen.coretbt_uiapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.coretbt_uiapp-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.coretbtwidgetapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.coretbtwidgetapp-1.0.0-arm.tpk index c0bb6c9..50649a8 100755 Binary files a/release/binary-armv7l/org.tizen.coretbtwidgetapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.coretbtwidgetapp-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.operationpickviewapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.operationpickviewapp-1.0.0-arm.tpk index eae3a12..d164220 100755 Binary files a/release/binary-armv7l/org.tizen.operationpickviewapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.operationpickviewapp-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.smartcard.actestapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.smartcard.actestapp-1.0.0-arm.tpk index 28b94a6..0acc32b 100755 Binary files a/release/binary-armv7l/org.tizen.smartcard.actestapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.smartcard.actestapp-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.smartcard.actestapp_signed-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.smartcard.actestapp_signed-1.0.0-arm.tpk index 45e55c0..b91027a 100755 Binary files a/release/binary-armv7l/org.tizen.smartcard.actestapp_signed-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.smartcard.actestapp_signed-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk index 64b4797..f4c3c4f 100644 Binary files a/release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.tbt_hcetestappa-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbt_hcetestappa-1.0.0-arm.tpk index 70eb066..ef20b23 100755 Binary files a/release/binary-armv7l/org.tizen.tbt_hcetestappa-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbt_hcetestappa-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.tbt_hcetestappb-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbt_hcetestappb-1.0.0-arm.tpk index a553570..e480db6 100755 Binary files a/release/binary-armv7l/org.tizen.tbt_hcetestappb-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbt_hcetestappb-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.tbt_nfcesetestapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbt_nfcesetestapp-1.0.0-arm.tpk index 7d2d1c3..55ae939 100755 Binary files a/release/binary-armv7l/org.tizen.tbt_nfcesetestapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbt_nfcesetestapp-1.0.0-arm.tpk differ diff --git a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk index 67db170..99850d1 100644 Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ diff --git a/release/binary-x86/org.tizen.coretbt_dataprovider-1.0.0-x86.tpk b/release/binary-x86/org.tizen.coretbt_dataprovider-1.0.0-x86.tpk old mode 100755 new mode 100644 index f50ea55..ba6e504 Binary files a/release/binary-x86/org.tizen.coretbt_dataprovider-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.coretbt_dataprovider-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.coretbt_serviceapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.coretbt_serviceapp-1.0.0-x86.tpk old mode 100755 new mode 100644 index 2ef3e92..cbedd64 Binary files a/release/binary-x86/org.tizen.coretbt_serviceapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.coretbt_serviceapp-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.coretbt_uiapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.coretbt_uiapp-1.0.0-x86.tpk old mode 100755 new mode 100644 index 18fe13d..bc7e512 Binary files a/release/binary-x86/org.tizen.coretbt_uiapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.coretbt_uiapp-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.coretbtwidgetapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.coretbtwidgetapp-1.0.0-x86.tpk old mode 100755 new mode 100644 index 90bf3e2..711de58 Binary files a/release/binary-x86/org.tizen.coretbtwidgetapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.coretbtwidgetapp-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.operationpickviewapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.operationpickviewapp-1.0.0-x86.tpk old mode 100755 new mode 100644 index b1ac466..5745349 Binary files a/release/binary-x86/org.tizen.operationpickviewapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.operationpickviewapp-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.smartcard.actestapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.smartcard.actestapp-1.0.0-x86.tpk old mode 100755 new mode 100644 index 382e9e9..f2bb9d0 Binary files a/release/binary-x86/org.tizen.smartcard.actestapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.smartcard.actestapp-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.smartcard.actestapp_signed-1.0.0-x86.tpk b/release/binary-x86/org.tizen.smartcard.actestapp_signed-1.0.0-x86.tpk old mode 100755 new mode 100644 index 5a181ba..f718d91 Binary files a/release/binary-x86/org.tizen.smartcard.actestapp_signed-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.smartcard.actestapp_signed-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.tbt-ime-1.0.0-x86.tpk b/release/binary-x86/org.tizen.tbt-ime-1.0.0-x86.tpk index 7def1e4..1e60ae6 100644 Binary files a/release/binary-x86/org.tizen.tbt-ime-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbt-ime-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.tbt_hcetestappa-1.0.0-x86.tpk b/release/binary-x86/org.tizen.tbt_hcetestappa-1.0.0-x86.tpk old mode 100755 new mode 100644 index 2222435..d40e7aa Binary files a/release/binary-x86/org.tizen.tbt_hcetestappa-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbt_hcetestappa-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.tbt_hcetestappb-1.0.0-x86.tpk b/release/binary-x86/org.tizen.tbt_hcetestappb-1.0.0-x86.tpk old mode 100755 new mode 100644 index d4d51a7..e872075 Binary files a/release/binary-x86/org.tizen.tbt_hcetestappb-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbt_hcetestappb-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.tbt_nfcesetestapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.tbt_nfcesetestapp-1.0.0-x86.tpk old mode 100755 new mode 100644 index 7947cb0..2b7d624 Binary files a/release/binary-x86/org.tizen.tbt_nfcesetestapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbt_nfcesetestapp-1.0.0-x86.tpk differ diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk index d730962..3cd134b 100644 Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk differ diff --git a/tbt-ime/src/tbt-ime.c b/tbt-ime/src/tbt-ime.c index df0a517..7d7ebdd 100644 --- a/tbt-ime/src/tbt-ime.c +++ b/tbt-ime/src/tbt-ime.c @@ -237,12 +237,12 @@ static void _preedit_on_key_clicked(void *data, Evas_Object *obj EINA_UNUSED, vo this->list = eina_list_append(this->list, attr); ret = ime_update_preedit_string("abcd", this->list); - RETM_IF(IME_ERROR_NONE!=ret, "ime_update_preedit_string fails :%s",_get_ime_error(ret)); if (ret != IME_ERROR_NONE) { EINA_LIST_FREE(this->list, attr) SAFE_DELETE(attr); } + SAFE_DELETE(attr); } diff --git a/tbt_hcetestappB/inc/logger.h b/tbt_hcetestappB/inc/logger.h index 90badf5..17f1107 100644 --- a/tbt_hcetestappB/inc/logger.h +++ b/tbt_hcetestappB/inc/logger.h @@ -52,6 +52,14 @@ return (val); \ } \ } +#define RETM_IF_ERROR(expr, fmt, arg...) \ +{ \ + if (expr) \ + { \ + ERR(fmt, ##arg); \ + return -1; \ + } \ +} #define SAFE_DELETE(a) if( (a) != NULL ) free (a); (a) = NULL; diff --git a/tbt_hcetestappB/src/tbt_hcetestappb.c b/tbt_hcetestappB/src/tbt_hcetestappb.c index f62b62d..fdb69e4 100644 --- a/tbt_hcetestappB/src/tbt_hcetestappb.c +++ b/tbt_hcetestappB/src/tbt_hcetestappb.c @@ -383,12 +383,17 @@ static int nfc_onoff_operation(void) { int ret = 0; app_control_h service = NULL; - app_control_create(&service); + ret = app_control_create(&service); if (service == NULL) { DBG("service_create failed!"); return 0; } + if(ret != APP_CONTROL_ERROR_NONE) + { + DBG("App control create failure!"); + return -1; + } app_control_set_operation(service, "http://tizen.org/appcontrol/operation/setting/nfc"); app_control_add_extra_data(service, "type", "nfc"); ret = app_control_send_launch_request(service, NULL, NULL); diff --git a/tbt_nfcesetestapp/src/nfcesetestapp.c b/tbt_nfcesetestapp/src/nfcesetestapp.c index b89f51a..546b1bb 100644 --- a/tbt_nfcesetestapp/src/nfcesetestapp.c +++ b/tbt_nfcesetestapp/src/nfcesetestapp.c @@ -84,6 +84,8 @@ Elm_Object_Item* _elm_genlist_item_append(appdata_s *this, char *item_text, void itc->func.del = _gl_del_cb; item_data *id = calloc(sizeof(item_data), 1); + RETVM_IF(id == NULL,NULL,"id is null "); + id->index = index++; id->text = strdup(item_text); diff --git a/tbtcoreapp/inc/utils/logger.h b/tbtcoreapp/inc/utils/logger.h index 772ceab..a68a8bd 100644 --- a/tbtcoreapp/inc/utils/logger.h +++ b/tbtcoreapp/inc/utils/logger.h @@ -43,6 +43,17 @@ } \ } +#define RETM_IF_CLEANUP(expr, fmt, FreeResource, arg...) \ +{ \ + if (expr) \ + { \ + ERR(fmt, ##arg); \ + FreeResource; \ + return; \ + } \ +} + + #define RETVM_IF(expr, val, fmt, arg...) \ { \ if (expr) \ @@ -52,6 +63,16 @@ } \ } +#define RETVM_IF_CLEANUP(expr, val, fmt, FreeResource, arg...) \ +{ \ + if (expr) \ + { \ + ERR(fmt, ##arg); \ + FreeResource; \ + return (val); \ + } \ +} + #define SAFE_DELETE(a) if( (a) != NULL ) free (a); (a) = NULL; #endif /* __LOGGER_H__ */ diff --git a/tbtcoreapp/src/main-app.c b/tbtcoreapp/src/main-app.c index a93994a..08346ce 100644 --- a/tbtcoreapp/src/main-app.c +++ b/tbtcoreapp/src/main-app.c @@ -267,6 +267,7 @@ static bool _app_create_cb(void *user_data) static void _app_terminate_cb(void *user_data) { app_data *ad = user_data; + char* edge_path=NULL; RETM_IF(NULL == ad, "app is null"); if(_tbt_app_terminate_cb != NULL) { @@ -276,8 +277,10 @@ static void _app_terminate_cb(void *user_data) #ifdef DEVICE_TYPE_WEARABLE if(get_device_type() == DEVICE_WEARABLE_360_360) { - elm_theme_overlay_del(NULL, get_edje_path("custom_button.edj")); + edge_path = get_edje_path("custom_button.edj"); + elm_theme_overlay_del(NULL, edge_path); } + SAFE_DELETE(edge_path); #endif win_destroy(ad->win); ad->win = NULL; diff --git a/tbtcoreapp/src/utils/ui-utils.c b/tbtcoreapp/src/utils/ui-utils.c index 5a9f262..070c4c0 100644 --- a/tbtcoreapp/src/utils/ui-utils.c +++ b/tbtcoreapp/src/utils/ui-utils.c @@ -88,7 +88,11 @@ char* ui_utils_genlist_text_add(const char *text) { char buf[MAX_LENGTH] = {'\0'}; snprintf(buf, MAX_LENGTH, "%s",font_size, text); - char *p = (char *)malloc(sizeof(buf)); + + char *p = NULL; + p = (char *)malloc(sizeof(buf)); + RETVM_IF(NULL == p, NULL, "malloc is failed"); + snprintf(p,strlen(buf), buf); return p; } @@ -105,7 +109,10 @@ char* ui_utils_text_add(const char *text, char *alignment) snprintf(buf, MAX_LENGTH, "

%s

", font_size, text); } - char *p = (char *)malloc(sizeof(buf)); + char *p = NULL; + p = (char *)malloc(sizeof(buf)); + RETVM_IF(NULL == p, NULL, "malloc is failed"); + snprintf(p,strlen(buf), buf); return p; } diff --git a/tbtcoreapp/src/utils/util_state_object.c b/tbtcoreapp/src/utils/util_state_object.c index 81c6310..5626df3 100644 --- a/tbtcoreapp/src/utils/util_state_object.c +++ b/tbtcoreapp/src/utils/util_state_object.c @@ -267,7 +267,9 @@ util_state_transition* util_state_object_add_transition(util_state_object *objec util_state_transition* transition = util_state_object_get_transition(from,feed_value); if(transition==NULL) { - transition=malloc(sizeof(util_state_transition)); + transition = malloc(sizeof(util_state_transition)); + RETVM_IF(NULL == transition, NULL, "malloc is failed"); + transition->destination=to; transition->input=feed_value; from->transitions = g_list_append(from->transitions,transition); diff --git a/tbtcoreapp/src/view/tbt-bluetooth-view.c b/tbtcoreapp/src/view/tbt-bluetooth-view.c index 0606318..27ef917 100644 --- a/tbtcoreapp/src/view/tbt-bluetooth-view.c +++ b/tbtcoreapp/src/view/tbt-bluetooth-view.c @@ -191,6 +191,8 @@ Elm_Object_Item* bluetooth_elm_genlist_item_append(char *item_text, Evas_Smart_C itc->func.del = bluetooth_gl_del_cb; item_data *id = calloc(sizeof(item_data), 1); + RETVM_IF(NULL == id,NULL, "calloc failed for id return NULL"); + id->index = index++; id->text = strdup(item_text); @@ -1356,7 +1358,9 @@ static void _control_button_pressed_cb(void *data, Evas_Object *obj, void *event result = bt_opp_client_initialize(); RETM_IF(result != BT_ERROR_NONE, "bt_opp_client_initialize fail > Error = %d", result); - result = bt_opp_client_add_file(get_shared_resource_path(this->view->tbt_info->file_name)); + char *file_path = get_shared_resource_path(this->view->tbt_info->file_name); + result = bt_opp_client_add_file(file_path); + SAFE_DELETE(file_path); RETM_IF(result != BT_ERROR_NONE, "bt_opp_client_add_file fail > Error = %d", result); if(this->selected_device_info != NULL) @@ -2683,10 +2687,12 @@ static void _app_destroy_cb(void* this) RETM_IF(NULL == view, "view is NULL"); #ifdef DEVICE_TYPE_WEARABLE - if(get_device_type() == DEVICE_WEARABLE_320_320) - { - elm_theme_overlay_del(NULL, get_edje_path("custom_button.edj")); - } + if(get_device_type() == DEVICE_WEARABLE_320_320) + { + char* edje_path = get_edje_path("custom_button.edj"); + elm_theme_overlay_del(NULL, edje_path); + SAFE_DELETE(edje_path); + } #endif if(view->view->tbt_info->apptype == TBT_APP_BT_SERVER_PAIRED) @@ -2847,16 +2853,26 @@ static void _app_destroy_cb(void* this) if(view->bt_player) { - player_stop(view->bt_player); - player_unprepare(view->bt_player); - player_destroy(view->bt_player); + result = player_stop(view->bt_player); + if(result != PLAYER_ERROR_NONE) + { + DBG("[player_stop] Failed."); + } + result = player_unprepare(view->bt_player); + if(result != PLAYER_ERROR_NONE) + { + DBG("[player_unprepare] Failed."); + } + result = player_destroy(view->bt_player); + if(result != PLAYER_ERROR_NONE) + { + DBG("[player_destroy] Failed."); + } view->bt_player = NULL; } SAFE_DELETE(view->view); SAFE_DELETE(view); - - } diff --git a/tbtcoreapp/src/view/tbt-bluetoothle-view.c b/tbtcoreapp/src/view/tbt-bluetoothle-view.c index 7ec5a32..7f99138 100644 --- a/tbtcoreapp/src/view/tbt-bluetoothle-view.c +++ b/tbtcoreapp/src/view/tbt-bluetoothle-view.c @@ -1450,7 +1450,8 @@ static void services_list_show(bluetoothle_view *this) char* svc_uuid; char* str; - bt_gatt_get_uuid(service_handle, &svc_uuid); + int ret = bt_gatt_get_uuid(service_handle, &svc_uuid); + RETM_IF(ret != BT_ERROR_NONE, "bt_gatt_get_uuid fail > Error = %s", get_bluetooth_error(ret)); str = format_string("Service UUID: %s",svc_uuid); diff --git a/tbtcoreapp/src/view/tbt-camera-view.c b/tbtcoreapp/src/view/tbt-camera-view.c index c742a28..e92c134 100644 --- a/tbtcoreapp/src/view/tbt-camera-view.c +++ b/tbtcoreapp/src/view/tbt-camera-view.c @@ -865,7 +865,7 @@ static char *save_file(camera_view *view, camera_image_data_s *image) RETVM_IF(NULL == file_name,NULL, "file_name is NULL"); FILE *f = fopen(file_name, "w"); - RETVM_IF(NULL == f, NULL, "fopen fail > File = %s", file_name); + RETVM_IF_CLEANUP(NULL == f, NULL, "fopen fail > File = %s",file_name; SAFE_DELETE(file_name)); unsigned size = image->size; unsigned char *data = image->data; @@ -974,7 +974,6 @@ static void _camera_capture_cb(camera_image_data_s *image, camera_image_data_s * { if (view->file_path != NULL) { - remove(view->file_path); SAFE_DELETE(view->file_path); } @@ -1098,7 +1097,7 @@ static void _camera_face_detected_cb(camera_detected_face_s *faces, int count, v for (i = 0; i < count; i++) { - draw_lines(faces[i].x, faces[i].y, faces[i].width, faces[i].height, i, view); + draw_lines(faces[i].x, faces[i].y, faces[i].height, faces[i].width, i, view); } } diff --git a/tbtcoreapp/src/view/tbt-common-view.c b/tbtcoreapp/src/view/tbt-common-view.c index 2c358e5..8f60197 100644 --- a/tbtcoreapp/src/view/tbt-common-view.c +++ b/tbtcoreapp/src/view/tbt-common-view.c @@ -221,6 +221,7 @@ static void wearable_circle_action(void *data, Evas_Object *obj, void *event_inf file_path = get_resource_path("images/pass.png"); image = ui_utils_create_image(parent, file_path); eext_more_option_item_part_content_set(item, "item,icon", image); + SAFE_DELETE(file_path); item = eext_more_option_item_append(parent); eext_more_option_item_part_text_set(item, "selector,main_text", "Fail"); @@ -228,6 +229,7 @@ static void wearable_circle_action(void *data, Evas_Object *obj, void *event_inf file_path = get_resource_path("images/fail.png"); image = ui_utils_create_image(parent, file_path); eext_more_option_item_part_content_set(item, "item,icon", image); + SAFE_DELETE(file_path); item = eext_more_option_item_append(parent); eext_more_option_item_part_text_set(item, "selector,main_text", "Info"); @@ -235,7 +237,8 @@ static void wearable_circle_action(void *data, Evas_Object *obj, void *event_inf file_path = get_resource_path("images/info.png"); image = ui_utils_create_image(parent, file_path); eext_more_option_item_part_content_set(item, "item,icon", image); - + + SAFE_DELETE(file_path); evas_object_smart_callback_add(parent, "more,option,opened", _more_option_opened, NULL); evas_object_smart_callback_add(parent, "more,option,closed", _more_option_closed, NULL); diff --git a/tbtcoreapp/src/view/tbt-contacts-view.c b/tbtcoreapp/src/view/tbt-contacts-view.c index 4dbc8a3..4b72b21 100644 --- a/tbtcoreapp/src/view/tbt-contacts-view.c +++ b/tbtcoreapp/src/view/tbt-contacts-view.c @@ -181,8 +181,6 @@ contacts_view *contacts_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Obje sprintf(resultc, "Total call and messages made to Test is = %d", usage_count); ui_utils_label_set_text(this->info_label, resultc, "left"); - - break; } elm_object_part_content_set(this->view->layout, "info_text", this->info_label); diff --git a/tbtcoreapp/src/view/tbt-datacontrol-view.c b/tbtcoreapp/src/view/tbt-datacontrol-view.c index b33ada6..42240f3 100644 --- a/tbtcoreapp/src/view/tbt-datacontrol-view.c +++ b/tbtcoreapp/src/view/tbt-datacontrol-view.c @@ -177,6 +177,8 @@ Elm_Object_Item* _elm_genlist_item_append(char *item_text, datacontrol_view *thi itc->func.del = _gl_del_cb; item_data *id = calloc(sizeof(item_data), 1); + RETVM_IF(NULL == id, NULL, "calloc fails id is null"); + id->index = index++; id->text = strdup(item_text); @@ -211,9 +213,10 @@ datacontrol_view *datacontrol_view_add(Evas_Object *navi, tbt_info *tbt_info, El RETVM_IF(NULL == navi, NULL, "navi is null"); this = calloc(1, sizeof(datacontrol_view)); + RETVM_IF(this==NULL, NULL, "calloc failed"); this->view = calloc(1, sizeof(common_view)); - RETVM_IF(!this->view, NULL, "calloc failed"); + RETVM_IF(this->view==NULL, NULL, "calloc failed"); this->data_inserted_flag = 0; this->row_count = MAX_LENGTH; @@ -1575,8 +1578,11 @@ static void _app_destroy_cb(void* data) #ifdef DEVICE_TYPE_WEARABLE if(get_device_type() == DEVICE_WEARABLE_320_320 || (get_device_type() == DEVICE_WEARABLE_360_360)) { - elm_theme_overlay_del(NULL, get_edje_path("custom_button.edj")); + char* edjefilePath = get_edje_path("custom_button.edj"); + elm_theme_overlay_del(NULL,edjefilePath); + SAFE_DELETE(edjefilePath); } + #endif data_control_destroy(this); diff --git a/tbtcoreapp/src/view/tbt-feature-view.c b/tbtcoreapp/src/view/tbt-feature-view.c index f22fdbb..8d1da78 100644 --- a/tbtcoreapp/src/view/tbt-feature-view.c +++ b/tbtcoreapp/src/view/tbt-feature-view.c @@ -105,6 +105,8 @@ Elm_Object_Item* _feature_elm_genlist_item_append(feature_view *this, char *item itc->func.del = _gl_del_cb; item_data *id = calloc(sizeof(item_data), 1); + RETVM_IF(id==NULL, NULL, "calloc failed id is NULL"); + id->index = index++; id->text = strdup(item_text); diff --git a/tbtcoreapp/src/view/tbt-image-view.c b/tbtcoreapp/src/view/tbt-image-view.c index 1e8d595..c722abf 100644 --- a/tbtcoreapp/src/view/tbt-image-view.c +++ b/tbtcoreapp/src/view/tbt-image-view.c @@ -79,7 +79,7 @@ image_view *image_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite file_path = get_resource_path(this->view->tbt_info->file_name); this->image = ui_utils_create_image(this->view->layout, file_path); - RETVM_IF(NULL == this->image, false, "create of layout elements failed"); + RETVM_IF_CLEANUP(NULL == this->image, false, "create of layout elements failed", SAFE_DELETE(file_path)); if(EINA_TRUE == elm_image_animated_available_get(this->image)) { @@ -89,9 +89,9 @@ image_view *image_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite elm_object_part_content_set(this->view->layout, "1cnt", this->image); - //int x,y,w,h; evas_object_geometry_get(this->image, &x, &y, &w, &h); DBG("Dim: %d %d %d %d", x, y, w, h); + SAFE_DELETE(file_path); return this; } diff --git a/tbtcoreapp/src/view/tbt-local-view.c b/tbtcoreapp/src/view/tbt-local-view.c index 996130b..a4de318 100644 --- a/tbtcoreapp/src/view/tbt-local-view.c +++ b/tbtcoreapp/src/view/tbt-local-view.c @@ -467,6 +467,7 @@ static player_h create_player(local_view *this) player_h player = NULL; int result = player_create(&player); + char* file_name=NULL; if(result == PLAYER_ERROR_NONE) { result = player_set_sound_type(player, SOUND_TYPE_MEDIA); @@ -475,7 +476,10 @@ static player_h create_player(local_view *this) RETVM_IF(result != PLAYER_ERROR_NONE, NULL, "player_set_volume fail > Error = %s", get_local_view_error(result)); result = player_set_looping(player, true); RETVM_IF(result != PLAYER_ERROR_NONE, NULL, "player_set_looping fail > Error = %s", get_local_view_error(result)); - result = player_set_uri(player, get_resource_path(this->view->tbt_info->file_name)); + file_name=get_resource_path(this->view->tbt_info->file_name); + result = player_set_uri(player, file_name); + SAFE_DELETE(file_name); + RETVM_IF(result != PLAYER_ERROR_NONE, NULL, "player_set_uri fail > Error = %s", get_local_view_error(result)); #ifdef DEVICE_TYPE_MOBILE result = player_set_display(player, PLAYER_DISPLAY_TYPE_EVAS, GET_DISPLAY(this->video_rect)); @@ -501,7 +505,6 @@ static player_h create_player(local_view *this) { ERR("player_pause fail > Error = %s", get_local_view_error(result)); } - return player; } diff --git a/tbtcoreapp/src/view/tbt-motion-detection-view.c b/tbtcoreapp/src/view/tbt-motion-detection-view.c index 4445408..ec8197a 100644 --- a/tbtcoreapp/src/view/tbt-motion-detection-view.c +++ b/tbtcoreapp/src/view/tbt-motion-detection-view.c @@ -99,7 +99,8 @@ motion_detection_view *motion_detection_view_add(Evas_Object *navi, tbt_info *tb elm_object_part_content_set(this->view->layout, "activity_text", this->activity_label); ui_utils_label_set_text(this->activity_label, "Activity Status", "left"); - const char *file_path; + + char *file_path; file_path = get_resource_path(this->view->tbt_info->file_name); this->activity_image = ui_utils_create_image(this->view->layout, file_path); @@ -107,13 +108,15 @@ motion_detection_view *motion_detection_view_add(Evas_Object *navi, tbt_info *tb evas_object_geometry_get(this->activity_image, &x, &y, &w, &h); DBG("Dim: %d %d %d %d", x, y, w, h); - RETVM_IF(NULL == this->activity_image, false, "creation of layout elements failed"); + RETVM_IF_CLEANUP(NULL == this->activity_image, false, "creation of layout elements failed",SAFE_DELETE(file_path)); elm_object_part_content_set(this->view->layout, "activity_image", this->activity_image); Evas_Object *control = add_control_layout(this, this->view->layout); elm_object_part_content_set(this->view->layout, "controlr_part", control); evas_object_show(control); + SAFE_DELETE(file_path); + return this; } @@ -229,7 +232,9 @@ static void _start_detection_button_pressed_cb(void *data, Evas_Object *obj, voi elm_naviframe_item_pop(this->view->navi); activity_stop_recognition(this->handle); activity_release(this->handle); - RETM_IF(nRet != ACTIVITY_ERROR_NONE, "activity_start_recognition failed for activity type = %s",_motion_get_activity_type(activity_type)); + char * error_string = _motion_get_activity_type(activity_type); + DBG("activity_start_recognition failed for activity type = %s", error_string); + SAFE_DELETE(error_string); } } @@ -248,7 +253,12 @@ static void activity_recognition_callback_check_type(activity_type_e activity, c DBG("activity_recognition_callback_check_type"); RETM_IF(NULL == user_data, "User data is NULL"); motion_detection_view *this = (motion_detection_view*)user_data; - snprintf(label, sizeof(label), "%s : %s" , "Activity Status is : ", _motion_get_activity_type(activity)); + + char * error_string = _motion_get_activity_type(activity); + + snprintf(label, sizeof(label), "%s : %s" , "Activity Status is : ", error_string); + SAFE_DELETE(error_string); + ui_utils_label_set_text(this->activity_label, label, "left"); return; } diff --git a/tbtcoreapp/src/view/tbt-nfc-view.c b/tbtcoreapp/src/view/tbt-nfc-view.c index 034259a..ee88ba4 100644 --- a/tbtcoreapp/src/view/tbt-nfc-view.c +++ b/tbtcoreapp/src/view/tbt-nfc-view.c @@ -264,14 +264,22 @@ void initialize_nfc(nfc_view *this) */ int nfc_onoff_operation(void) { - int ret = 0; + int ret = -1; + app_control_h service = NULL; - app_control_create(&service); + ret = app_control_create(&service); + + if(ret == -1) + { + DBG("service_create failed!"); + return -1; + } if (service == NULL) { DBG("service_create failed!"); - return 0; + return -1; } + app_control_set_operation(service, "http://tizen.org/appcontrol/operation/setting/nfc"); app_control_add_extra_data(service, "type", "nfc"); ret = app_control_send_launch_request(service, NULL, NULL); diff --git a/tbtcoreapp/src/view/tbt-nsd-dns-sd-view.c b/tbtcoreapp/src/view/tbt-nsd-dns-sd-view.c index d11a7ab..9bd7115 100644 --- a/tbtcoreapp/src/view/tbt-nsd-dns-sd-view.c +++ b/tbtcoreapp/src/view/tbt-nsd-dns-sd-view.c @@ -122,6 +122,8 @@ Elm_Object_Item* _nsd_dnssd_elm_genlist_item_append(Evas_Object* list, char *ite itc->func.del = _gl_del_cb; item_data *id = calloc(sizeof(item_data), 1); + RETVM_IF(NULL == id, NULL, "calloc failed"); + id->index = index++; id->text = strdup(item_text); @@ -320,7 +322,7 @@ static void _dnssd_found_cb(dnssd_service_state_e service_state, dnssd_service_h res = dnssd_service_get_name(remote_service, &service_name); RETM_IF(res != DNSSD_ERROR_NONE, "dnssd_service_get_name fail > Error = %s", get_dns_sd_error(res)); - if(service_name != NULL && sizeof(service_name) >0) + if(service_name != NULL) { str = format_string("service name: %s", service_name); #ifdef USE_GENLIST @@ -334,7 +336,7 @@ static void _dnssd_found_cb(dnssd_service_state_e service_state, dnssd_service_h res = dnssd_service_get_type(remote_service, &service_type); RETM_IF(res != DNSSD_ERROR_NONE, "dnssd_service_get_type fail > Error = %s", get_dns_sd_error(res)); - if(service_type != NULL && sizeof(service_type) >0) + if(service_type != NULL) { str = format_string("service type: %s", service_type); #ifdef USE_GENLIST @@ -348,7 +350,7 @@ static void _dnssd_found_cb(dnssd_service_state_e service_state, dnssd_service_h res = dnssd_service_get_ip(remote_service, &ipv4, &ipv6); RETM_IF(res != DNSSD_ERROR_NONE, "dnssd_service_get_ip fail > Error = %s", get_dns_sd_error(res)); - if(ipv4 != NULL && sizeof(ipv4) >0) + if(ipv4 != NULL) { str = format_string("ipv4: %s", ipv4); #ifdef USE_GENLIST @@ -358,7 +360,7 @@ static void _dnssd_found_cb(dnssd_service_state_e service_state, dnssd_service_h #endif SAFE_DELETE(str); } - if(ipv6 != NULL && sizeof(ipv6) >0) + if(ipv6 != NULL) { str = format_string("ipv6: %s", ipv6); #ifdef USE_GENLIST @@ -683,15 +685,22 @@ static char** str_split(char* a_str, const char a_delim) { size_t idx = 0; char* token = strtok(a_str, delim); + RETVM_IF(token == NULL, NULL,"strtok failed"); - while (token) - { - RETVM_IF(idx >= count, NULL, "idx >= count"); - *(result + idx++) = strdup(token); - token = strtok(0, delim); - } - *(result + idx) = 0; - } + while (token) + { + if(idx < count) + { + *(result + idx++) = strdup(token); + token = strtok(0, delim); + } + else + { + break; + } + } + *(result + idx) = 0;; + } return result; } diff --git a/tbtcoreapp/src/view/tbt-pick-view.c b/tbtcoreapp/src/view/tbt-pick-view.c index 0ddd320..573f5eb 100644 --- a/tbtcoreapp/src/view/tbt-pick-view.c +++ b/tbtcoreapp/src/view/tbt-pick-view.c @@ -156,6 +156,8 @@ Elm_Object_Item* _pick_elm_genlist_item_append(pick_view *this, char *item_text, itc->func.del = _gl_del_cb; item_data *id = calloc(sizeof(item_data), 1); + RETVM_IF(id == NULL, NULL, "malloc failed"); + id->index = index++; id->text = strdup(item_text); @@ -408,6 +410,8 @@ static void _add_urls_all(pick_view *this) Elm_Object_Item* it; this->all = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->all == NULL, "malloc failed"); + this->all->uri = NULL; this->all->mime = "*/*"; //it = elm_list_item_append(this->data_list, "All", NULL, NULL, _view, this->all); @@ -423,6 +427,8 @@ static void _add_urls_image(pick_view *this) Elm_Object_Item* it; this->image = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->image == NULL, "malloc failed"); + this->image->uri = NULL; this->image->mime = "image/*"; //it = elm_list_item_append(this->data_list, "Image", NULL, NULL, _view, this->image); @@ -438,6 +444,8 @@ static void _add_urls_video(pick_view *this) Elm_Object_Item* it; this->video = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->video == NULL, "malloc failed"); + this->video->uri = NULL; this->video->mime = "video/*"; //it = elm_list_item_append(this->data_list, "Video", NULL, NULL, _view, this->video); @@ -453,6 +461,8 @@ static void _add_urls_audio(pick_view *this) Elm_Object_Item* it; this->audio = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->audio == NULL, "malloc failed"); + this->audio->uri = NULL; this->audio->mime = "audio/*"; //it = elm_list_item_append(this->data_list, "Audio", NULL, NULL, _view, this->audio); @@ -474,12 +484,16 @@ static void _add_urls(pick_view *this) { this->http = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->http == NULL, "malloc failed"); + this->http->uri = PICK_VIEW_URL_HTTP; this->http->mime = NULL; //it = elm_list_item_append(this->data_list, PICK_VIEW_URL_HTTP, NULL, NULL, _view, this->http); pick_list_view_append(this, PICK_VIEW_URL_HTTP, _view, this->http); this->https = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->https == NULL, "malloc failed"); + this->https->uri = PICK_VIEW_URL_HTTPS; this->https->mime = NULL; //it = elm_list_item_append(this->data_list, PICK_VIEW_URL_HTTPS, NULL, NULL, _view, this->https); @@ -494,6 +508,8 @@ static void _add_urls(pick_view *this) { this->all = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->all == NULL, "malloc failed"); + this->all->uri = NULL; this->all->mime = "*/*"; //it = elm_list_item_append(this->data_list, "All", NULL, NULL, _view, this->all); @@ -501,6 +517,8 @@ static void _add_urls(pick_view *this) this->image = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->image == NULL, "malloc failed"); + this->image->uri = NULL; this->image->mime = "image/*"; //it = elm_list_item_append(this->data_list, "Image", NULL, NULL, _view, this->image); @@ -508,12 +526,16 @@ static void _add_urls(pick_view *this) this->video = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->video == NULL, "malloc failed"); + this->video->uri = NULL; this->video->mime = "video/*"; //it = elm_list_item_append(this->data_list, "Video", NULL, NULL, _view, this->video); pick_list_view_append(this, "Video", _view, this->video); this->audio = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->audio == NULL, "malloc failed"); + this->audio->uri = NULL; this->audio->mime = "audio/*"; //it = elm_list_item_append(this->data_list, "Audio", NULL, NULL, _view, this->audio); @@ -531,6 +553,8 @@ static void _add_images(pick_view *this) //elm_list_clear(this->data_list); this->bmp = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->bmp == NULL, "malloc failed"); + this->bmp->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_IMAGE_BMP); DBG("PICK_VIEW_IMAGE_BMP:%s", this->bmp->uri); this->bmp->mime = "image/bmp"; @@ -539,6 +563,8 @@ static void _add_images(pick_view *this) //elm_object_item_data_set(it, "image/bmp"); this->jpg = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->jpg == NULL, "malloc failed"); + this->jpg->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_IMAGE_JPG); DBG("PICK_VIEW_IMAGE_JPG:%s", this->jpg->uri); this->jpg->mime = "image/jpeg"; @@ -547,6 +573,8 @@ static void _add_images(pick_view *this) //elm_object_item_data_set(it, "image/jpeg"); this->gif = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->gif == NULL, "malloc failed"); + this->gif->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_IMAGE_GIF); DBG("PICK_VIEW_IMAGE_GIF:%s", this->gif->uri); this->gif->mime = "image/gif"; @@ -555,6 +583,8 @@ static void _add_images(pick_view *this) //elm_object_item_data_set(it, "image/gif"); this->png = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->png == NULL, "malloc failed"); + this->png->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_IMAGE_PNG); DBG("PICK_VIEW_IMAGE_PNG:%s", this->png->uri); this->png->mime = "image/png"; @@ -573,6 +603,8 @@ static void _add_sounds(pick_view *this) //elm_list_clear(this->data_list); this->aac = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->aac == NULL, "malloc failed"); + this->aac->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_SOUND_AAC); DBG("PICK_VIEW_SOUND_AAC:%s", this->aac->uri); this->aac->mime = "audio/aac"; @@ -581,6 +613,8 @@ static void _add_sounds(pick_view *this) //elm_object_item_data_set(it, "image/bmp"); this->amr = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->amr == NULL, "malloc failed"); + this->amr->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_SOUND_AMR); DBG("PICK_VIEW_SOUND_AMR:%s", this->amr->uri); this->amr->mime = "audio/amr"; @@ -589,6 +623,8 @@ static void _add_sounds(pick_view *this) //elm_object_item_data_set(it, "image/jpeg"); this->mp3 = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->mp3 == NULL, "malloc failed"); + this->mp3->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_SOUND_MP3); DBG("PICK_VIEW_SOUND_MP3:%s", this->mp3->uri); this->mp3->mime = "audio/mp3"; @@ -597,6 +633,8 @@ static void _add_sounds(pick_view *this) //elm_object_item_data_set(it, "image/gif"); this->wav = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->wav == NULL, "malloc failed"); + this->wav->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_SOUND_WAV); DBG("PICK_VIEW_SOUND_WAV:%s", this->wav->uri); this->wav->mime = "audio/wav"; @@ -615,6 +653,8 @@ static void _add_videos(pick_view *this) //elm_list_clear(this->data_list); this->gp3 = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->gp3 == NULL, "malloc failed"); + this->gp3->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_VIDEO_3GP); DBG("PICK_VIEW_VIDEO_3GP:%s", this->gp3->uri); this->gp3->mime = "video/3gpp"; @@ -623,6 +663,8 @@ static void _add_videos(pick_view *this) //elm_object_item_data_set(it, "image/bmp"); this->mp4 = (view_item*)malloc(sizeof(view_item)); + RETM_IF(this->mp4 == NULL, "malloc failed"); + this->mp4->uri = format_string("file://%s%s", this->shared_res_path, PICK_VIEW_VIDEO_MP4); DBG("PICK_VIEW_VIDEO_MP4:%s", this->mp4->uri); this->mp4->mime = "video/mp4"; diff --git a/tbtcoreapp/src/view/tbt-sensor-view.c b/tbtcoreapp/src/view/tbt-sensor-view.c index a56570f..46eb09b 100644 --- a/tbtcoreapp/src/view/tbt-sensor-view.c +++ b/tbtcoreapp/src/view/tbt-sensor-view.c @@ -798,8 +798,9 @@ static void genlist_sensor_value_items_update(sensor_view *view, float *values) file_path = get_resource_path(view->view->tbt_info->file_name); view->proximity_off_image = ui_utils_create_image(view->view->layout, file_path); - RETM_IF(NULL == view->proximity_off_image, "create of proximity_on_image failed"); + RETM_IF_CLEANUP(NULL == view->proximity_off_image, "create of proximity_on_image failed", SAFE_DELETE(file_path)); DBG("File loaded successfull"); + SAFE_DELETE(file_path); elm_object_part_content_set(view->view->layout, "1cnt", view->proximity_off_image); @@ -811,8 +812,9 @@ static void genlist_sensor_value_items_update(sensor_view *view, float *values) file_path = get_resource_path(view->view->tbt_info->extra_file_name); view->proximity_on_image = ui_utils_create_image(view->view->layout, file_path); - RETM_IF(NULL == view->proximity_on_image, "create of proximity_on_image failed"); + RETM_IF_CLEANUP(NULL == view->proximity_on_image, "create of proximity_on_image failed", SAFE_DELETE(file_path)); DBG("File loaded successfull"); + SAFE_DELETE(file_path); elm_object_part_content_set(view->view->layout, "1cnt", view->proximity_on_image); diff --git a/tbtcoreapp/src/view/tbt-sound-view.c b/tbtcoreapp/src/view/tbt-sound-view.c index 9caeb19..6babca9 100644 --- a/tbtcoreapp/src/view/tbt-sound-view.c +++ b/tbtcoreapp/src/view/tbt-sound-view.c @@ -315,8 +315,12 @@ sound_view *sound_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Ite this->is_feature_supported = true; - this->audio_icon = ui_utils_create_image(this->view->layout, get_resource_path("images/audio-icon.png")); - RETVM_IF(NULL == this->audio_icon, false, "create of layout elements failed"); + char* image_path = NULL; + image_path = get_resource_path("images/audio-icon.png"); + this->audio_icon = ui_utils_create_image(this->view->layout, image_path); + RETVM_IF_CLEANUP(NULL == this->audio_icon, false, "create of layout elements failed", SAFE_DELETE(image_path)); + SAFE_DELETE(image_path); + elm_object_part_content_set(this->view->layout, "1txt_2cnt", this->audio_icon); if(this->view->tbt_info->apptype == TBT_APP_SOUND_VOLUME) @@ -684,8 +688,11 @@ static void _slider_drag_stop_cb(void *data, Evas_Object *obj, void *event_info) view = (sound_view*)data; RETM_IF(NULL == view, "view is NULL"); - double val = elm_slider_value_get(obj); - player_set_volume(view->player, val, val); + double val = 0.0; + val = elm_slider_value_get(obj); + RETM_IF(0.0 == val, "slider val is 0"); + + player_set_volume(view->player, val, val); } diff --git a/tbtcoreapp/src/view/tbt-stt-view.c b/tbtcoreapp/src/view/tbt-stt-view.c index e25c233..378ad48 100644 --- a/tbtcoreapp/src/view/tbt-stt-view.c +++ b/tbtcoreapp/src/view/tbt-stt-view.c @@ -118,6 +118,8 @@ Elm_Object_Item* _stt_elm_genlist_item_append(Evas_Object* list, char *item_text itc->func.del = _gl_del_cb; item_data *id = calloc(sizeof(item_data), 1); + RETVM_IF(NULL == id, NULL, "calloc is failed"); + id->index = index++; id->text = strdup(item_text); diff --git a/tbtcoreapp/src/view/tbt-systemsettings-view.c b/tbtcoreapp/src/view/tbt-systemsettings-view.c index 213fa2c..6c8dc01 100755 --- a/tbtcoreapp/src/view/tbt-systemsettings-view.c +++ b/tbtcoreapp/src/view/tbt-systemsettings-view.c @@ -106,9 +106,9 @@ char* get_system_settings_error(int ret) systemsettings_view *systemsettings_view_add(Evas_Object *navi, tbt_info *tbt_info, Elm_Object_Item *item) { RETVM_IF(NULL == navi, NULL, "navi is null"); - int ret, value; + int ret, value = -1; int timevalue = 0; - bool bvalue; + bool bvalue = false; systemsettings_view *this = NULL; this = calloc(1, sizeof(systemsettings_view)); RETVM_IF(!this, NULL, "calloc failed");