[SVACE][TBT_W][Fixed SVACE Issues for TBT Wearble module] 28/150728/4
authorABHISHEK JAIN <j.abhishek@samsung.com>
Mon, 18 Sep 2017 09:54:07 +0000 (15:24 +0530)
committerShilpa Jindal <shilpa.j@samsung.com>
Tue, 19 Sep 2017 04:12:28 +0000 (04:12 +0000)
Signed-off-by: ABHISHEK JAIN <j.abhishek@samsung.com>
Change-Id: Ib105b1f70e0e25408a0c854aea6712d5089d232a

53 files changed:
coretbtuiapp/inc/coretbt_uiapp.h
coretbtuiapp/src/coretbt_uiapp.c
operationpickviewapp/inc/logger.h
operationpickviewapp/src/operationpickviewapp.c
release/binary-armv7l/org.tizen.coretbt_dataprovider-1.0.0-arm.tpk [changed mode: 0755->0644]
release/binary-armv7l/org.tizen.coretbt_serviceapp-1.0.0-arm.tpk [changed mode: 0755->0644]
release/binary-armv7l/org.tizen.coretbt_uiapp-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.coretbtwidgetapp-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.operationpickviewapp-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.smartcard.actestapp-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.smartcard.actestapp_signed-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.tbt-ime-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.tbt_hcetestappa-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.tbt_hcetestappb-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.tbt_nfcesetestapp-1.0.0-arm.tpk
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.coretbt_dataprovider-1.0.0-x86.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.coretbt_serviceapp-1.0.0-x86.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.coretbt_uiapp-1.0.0-x86.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.coretbtwidgetapp-1.0.0-x86.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.operationpickviewapp-1.0.0-x86.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.smartcard.actestapp-1.0.0-x86.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.smartcard.actestapp_signed-1.0.0-x86.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.tbt-ime-1.0.0-x86.tpk
release/binary-x86/org.tizen.tbt_hcetestappa-1.0.0-x86.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.tbt_hcetestappb-1.0.0-x86.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.tbt_nfcesetestapp-1.0.0-x86.tpk [changed mode: 0755->0644]
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk
tbt-ime/src/tbt-ime.c
tbt_hcetestappB/inc/logger.h
tbt_hcetestappB/src/tbt_hcetestappb.c
tbt_nfcesetestapp/src/nfcesetestapp.c
tbtcoreapp/inc/utils/logger.h
tbtcoreapp/src/main-app.c
tbtcoreapp/src/utils/ui-utils.c
tbtcoreapp/src/utils/util_state_object.c
tbtcoreapp/src/view/tbt-bluetooth-view.c
tbtcoreapp/src/view/tbt-bluetoothle-view.c
tbtcoreapp/src/view/tbt-camera-view.c
tbtcoreapp/src/view/tbt-common-view.c
tbtcoreapp/src/view/tbt-contacts-view.c
tbtcoreapp/src/view/tbt-datacontrol-view.c
tbtcoreapp/src/view/tbt-feature-view.c
tbtcoreapp/src/view/tbt-image-view.c
tbtcoreapp/src/view/tbt-local-view.c
tbtcoreapp/src/view/tbt-motion-detection-view.c
tbtcoreapp/src/view/tbt-nfc-view.c
tbtcoreapp/src/view/tbt-nsd-dns-sd-view.c
tbtcoreapp/src/view/tbt-pick-view.c
tbtcoreapp/src/view/tbt-sensor-view.c
tbtcoreapp/src/view/tbt-sound-view.c
tbtcoreapp/src/view/tbt-stt-view.c
tbtcoreapp/src/view/tbt-systemsettings-view.c

index 9d065815251bc8ca2e3d4c98bf845a6c99fc1fa5..115f108d2ed3b188df9debc6cdac0b3a47ced2e9 100644 (file)
@@ -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;
index 0492cc59e59044569051a1d0c58acca806c7ae9c..b500d35151e47d8c7eb62ca1424be2c138456ab4 100644 (file)
@@ -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);
 
index b2f6119bfa271436834cd9d4dcf1adbe6325edd8..7e6f5acc9d35425fc707812811a3a6f9d925bbf9 100644 (file)
     } \
 }
 
+#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__ */
index 21457b37d377957dc8fa9471b296671aa1dc4748..eedea6c9f76ec2c858776fc2238a0f2e3c564b1c 100644 (file)
@@ -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);
old mode 100755 (executable)
new mode 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
index 0acb5d17b6328b6de32d72b968a63211ec9ceb4e..bf16cf9612d93c86fc0771af101db8f7f5ae5d69 100755 (executable)
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
index c0bb6c9a646fe56fa7664eb4bd207d0767247592..50649a8f5f7b5eb8026a6a180d5ca9f205c876b9 100755 (executable)
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
index eae3a124eb107252ed3a80fbbd4e6dd918d6bb57..d164220909cd9e5549894f45e345d02408a83b22 100755 (executable)
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
index 28b94a6216811b799cbe9824f3f1f1d5273aab85..0acc32bf72c25371328d1fc8353bb096af6657b1 100755 (executable)
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
index 45e55c0d78e48018c402d2cc08f2211fd61e00d7..b91027ae0ebcd701b1e757c2b982c63a2f85033f 100755 (executable)
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
index 64b4797726665bbfa501b4e6d21d13c210780b1a..f4c3c4f221940a348ccff8305ca6ef19d84ab640 100644 (file)
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
index 70eb066117d8def9dab0485dfb50eafcf14c5055..ef20b23a6ada59331e1009196d298f9ca13ecd30 100755 (executable)
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
index a553570c434c9441f899be02abe45723ba0c83c8..e480db6b0350c79164aef2715d32bea664c59da0 100755 (executable)
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
index 7d2d1c39853459d47b346484c743888682d8f00f..55ae9396b7810e87dc0a5fbd88e062cb749cb094 100755 (executable)
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
index 67db170a3b1333461c8cfe2de39735bf78ee9c9c..99850d19150526808611991508f8e9a0851f7280 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
index 7def1e4e852b0339e04decea2cba81f657d113ab..1e60ae6002f1dbb1a30beb315d7589a007230edc 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
old mode 100755 (executable)
new mode 100644 (file)
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
index d730962730e73dde2ebc90921a48adbd9a9b9126..3cd134b470333642f6f783f6b0769dc7e93f22af 100644 (file)
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
index df0a517305985e5247a34246f992c047cf488f1d..7d7ebddf9b4afe3154e74a461f023d1c799fdfd8 100644 (file)
@@ -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);
 
 }
 
index 90badf5c09def0515675147c29b35602a5bb6553..17f1107e80102cf7ea2e3816eeb7ba62bcef7306 100644 (file)
         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;
 
index f62b62d88c471a3f1eaed8896573c3faa0870e88..fdb69e4f5b9f50428d2aad7b80aec8c1f943b97d 100644 (file)
@@ -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);
index b89f51ae7fadbc0172990bda14d3a9bc7d37c571..546b1bb57c8819135454f0d1fb1030ab2d2a1b12 100644 (file)
@@ -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);
 
index 772ceab61ff057729bdd327dc78c9a61c19264eb..a68a8bd62791e6f09c2118824df9dc984b13729b 100644 (file)
     } \
 }
 
+#define RETM_IF_CLEANUP(expr, fmt, FreeResource, arg...) \
+{ \
+    if (expr) \
+    { \
+        ERR(fmt, ##arg); \
+       FreeResource; \
+        return; \
+    } \
+}
+
+
 #define RETVM_IF(expr, val, fmt, arg...) \
 { \
     if (expr) \
     } \
 }
 
+#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__ */
index a93994a8c72c7b86344482c5e2880c9cfcb54b9a..08346ce390f1595681443876d165f1866a74e56d 100644 (file)
@@ -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;
index 5a9f2626943a7f7988d74add4977ef976b5d1cf1..070c4c06fa10f9eb7977be863a205b1afbb635b7 100644 (file)
@@ -88,7 +88,11 @@ char* ui_utils_genlist_text_add(const char *text)
 {
     char buf[MAX_LENGTH] = {'\0'};
     snprintf(buf, MAX_LENGTH, "<font_size=%d>%s</font_size>",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, "<p align=center><font_size=%d>%s</font></p>", 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;
 }
index 81c631027b0f196e0eace47fdcfa9ec1f0f6716e..5626df3da86a125e0fcb78a053f2fda715d63231 100644 (file)
@@ -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);
index 060631842fa110a3baa0f9a18bf1003ba7ba0b39..27ef917198d086e820525c3719736d6135b927a2 100644 (file)
@@ -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);
-
-
 }
 
 
index 7ec5a32ed16fc6f3a6832b09c08bc43ff7a60b5c..7f99138c853633c9d5acfe3df32ad57372e1cdff 100644 (file)
@@ -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);
 
index c742a28c893f41e8f092a17452228c04e53471b3..e92c134c16f785cd92cf0f0b498094a37af908dd 100644 (file)
@@ -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);
        }
 
 }
index 2c358e5856795f6695df8cda9d115c6fa22636ca..8f60197a251e937d0efc91d6c25977b3f4c6fcb5 100644 (file)
@@ -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);
index 4dbc8a39091bb6f104aefdbb69737076d9ae4088..4b72b21d0a26412f9e423c4065f8a4de6b8a8a28 100644 (file)
@@ -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);
index b33ada6eaf41ef0ab6a02be46a27fe5380afbc60..42240f30a5dfb700e655197b2f3ef0d7013bf144 100644 (file)
@@ -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);
index f22fdbbd8e844cf68d699db07a8cfaf4c826af24..8d1da78bc93c5fbf25edf2f5392ba74806f28b23 100644 (file)
@@ -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);
 
index 1e8d5951d94e26de96d696c8d4be0719e57068fb..c722abfcdbc11e7e4eaa4ff6c8412b15bbb3667f 100644 (file)
@@ -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;
 }
index 996130b4e3fe6b9c084cc7dacec19f2c441237e4..a4de318ff6b2122d9517887d9f02507e69b96d81 100644 (file)
@@ -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;
 }
 
index 444540884ff19eedb9a9b36449c3057d61d41073..ec8197a66e9e3368da72ace6aa4c9c0ceb338f36 100644 (file)
@@ -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;
 }
index 034259aef346e1a738a923eb347b0fdfa86128bd..ee88ba41f001f53016630c6e916597c12aa8991a 100644 (file)
@@ -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);
index d11a7ab36cf3c14c2280dc3e4a0014b383681299..9bd7115bd25de5097921f497ff7348f558fcc6c4 100644 (file)
@@ -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;
 }
index 0ddd3205d4051c3c61070fe51c7c3c9a404f2aa9..573f5ebf787daf623e48a7bc5217b9faf08dcaa3 100644 (file)
@@ -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";
index a56570fc8eec19ce36dbce9cdd0ed65deeaac857..46eb09bee11d682999c847462dd1c6b03c1b3c0d 100644 (file)
@@ -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);
 
index 9caeb1904728c91f13422b88a39d3dc6ce0edb1a..6babca9550dc064b660c8f86cb1057d6b257b72c 100644 (file)
@@ -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);
 }
 
 
index e25c2336427a6963e195d6755f4b55724f2f775e..378ad4829d5c6582a79fa54d1a45f587cf255df7 100644 (file)
@@ -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);
 
index 213fa2cb2242ba1decd86cb41da85bfc40d0350b..6c8dc01bb9f3974f3e2c223b6e2e5472c28a6f76 100755 (executable)
@@ -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");