PVS issues 89/142689/3 accepted/tizen/4.0/unified/20170828.223110 accepted/tizen/unified/20170809.015334 submit/tizen/20170808.125248 submit/tizen_4.0/20170828.100009
authorYoungHun Cho <hoon.cho@samsung.com>
Mon, 7 Aug 2017 04:54:15 +0000 (13:54 +0900)
committerYoungHun Cho <hoon.cho@samsung.com>
Tue, 8 Aug 2017 07:03:52 +0000 (16:03 +0900)
Change-Id: I4302f2b7838477ab572e3e700a57e94ec61114fa

src/apps/apps_callback_manager.c
src/apps/apps_data_db.c
src/apps/apps_view_circle.c
src/apps/apps_view_circle_icon_page.c
src/apps/apps_view_circle_indicator.c
src/edit.c
src/notification/noti_detail_view.c
src/notification/noti_popup_small_view.c

index bba21f3029c84f43b7ebe5c8ab08ac158c710848..92fecda9cb7175f0e612493493e346c522462edd 100755 (executable)
@@ -21,6 +21,9 @@ apps_callback_t *apps_callback_manager_new(void)
 {
        apps_callback_t *callback_stack = NULL;
        callback_stack = (apps_callback_t *)malloc(sizeof(apps_callback_t));
+       if (callback_stack == NULL)
+               return NULL;
+
        callback_stack->cb_count = 0;
 
        return callback_stack;
index 8bce374ca2060c3c48f472cc5bb61baf0117336c..2c688c82e605c50edfc716654812d8b87987c90c 100755 (executable)
@@ -226,25 +226,27 @@ Eina_List *apps_data_db_get_icon_list(void)
 
        while (sqlite3_step(stmt) == SQLITE_ROW) {
                APP_INFO *item = (APP_INFO *)malloc(sizeof(APP_INFO));
-               memset(item, 0, sizeof(APP_INFO));
+               if (item) {
+                       memset(item, 0, sizeof(APP_INFO));
 
-               item->db_id = sqlite3_column_int(stmt, COL_ID);
+                       item->db_id = sqlite3_column_int(stmt, COL_ID);
 
-               str = (const char *) sqlite3_column_text(stmt, COL_APPLICATION_ID);
-               item->app_id = (!str || !strlen(str)) ? NULL : strdup(str);
+                       str = (const char *) sqlite3_column_text(stmt, COL_APPLICATION_ID);
+                       item->app_id = (!str || !strlen(str)) ? NULL : strdup(str);
 
-               str = (const char *) sqlite3_column_text(stmt, COL_PACKAGE_ID);
-               item->pkg_id = (!str || !strlen(str)) ? NULL : strdup(str);
+                       str = (const char *) sqlite3_column_text(stmt, COL_PACKAGE_ID);
+                       item->pkg_id = (!str || !strlen(str)) ? NULL : strdup(str);
 
-               str = (const char *) sqlite3_column_text(stmt, COL_LABEL);
-               item->label = (!str) ? NULL : strdup(str);
+                       str = (const char *) sqlite3_column_text(stmt, COL_LABEL);
+                       item->label = (!str) ? NULL : strdup(str);
 
-               str = (const char *)sqlite3_column_text(stmt, COL_ICON_PATH);
-               item->icon_path = (!str || !strlen(str)) ? NULL : strdup(str);
+                       str = (const char *)sqlite3_column_text(stmt, COL_ICON_PATH);
+                       item->icon_path = (!str || !strlen(str)) ? NULL : strdup(str);
 
-               item->index = sqlite3_column_int(stmt, COL_INDEX);
+                       item->index = sqlite3_column_int(stmt, COL_INDEX);
 
-               list = eina_list_append(list, item);
+                       list = eina_list_append(list, item);
+               }
        }
        sqlite3_finalize(stmt);
        __close_db_connector();
@@ -297,7 +299,6 @@ void apps_data_db_set_data(char *key, char *value)
        }
 
        __insert_data_value(key, value);
-       free(v);
 }
 
 static bool __init_db_connector(void)
index beb12cfaca8093e6c57d4542ab843a11b722de2d..5e15e8c17403b62a7c36060330957812c7d4ab39 100755 (executable)
@@ -393,16 +393,18 @@ void __apps_view_circle_get_access_focus_text(Eina_List **list)
        markup_str = buf ? elm_entry_markup_to_utf8(buf) : NULL;
 
        access_info_t *info = (access_info_t *) malloc(sizeof(access_info_t));
-       info->is_access_obj = EINA_FALSE;
-       info->target = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(s_info.base_layout), APPS_FOCUS_TEXT);
-       info->parent = s_info.base_layout;
-       info->name = markup_str ? strdup(markup_str) : NULL;
-       info->description = NULL;
-       info->role = ELM_ATSPI_ROLE_UNKNOWN;
-       info->clicked_cb = __apps_view_circle_tap_focus_text;
-       info->priority = ACCESS_PRIORITY_APP_FOCUS_TEXT;
-
-       *list = eina_list_append(*list, info);
+       if (info) {
+               info->is_access_obj = EINA_FALSE;
+               info->target = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(s_info.base_layout), APPS_FOCUS_TEXT);
+               info->parent = s_info.base_layout;
+               info->name = markup_str ? strdup(markup_str) : NULL;
+               info->description = NULL;
+               info->role = ELM_ATSPI_ROLE_UNKNOWN;
+               info->clicked_cb = __apps_view_circle_tap_focus_text;
+               info->priority = ACCESS_PRIORITY_APP_FOCUS_TEXT;
+
+               *list = eina_list_append(*list, info);
+       }
 
        free(markup_str);
 
index f32d0161f3fd2f92220d8defed48108a16fed5bc..b4ab85b0262b13cacfac4543f6d54510b14a819b 100755 (executable)
@@ -1195,16 +1195,18 @@ void __apps_view_circle_get_access_page_layout(Eina_List **list)
        snprintf(buf, sizeof(buf), _("IDS_AT_BODY_PAGE_P1SD_OF_P2SD_T_TTS"), s_info.current_page + 1, s_info.page_count);
 
        access_info_t *info = (access_info_t *) malloc(sizeof(access_info_t));
-       info->is_access_obj = EINA_FALSE;
-       info->target = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(s_info.layout), SIZE_SETTER);
-       info->parent = s_info.layout;
-       info->name = strdup(buf);
-       info->description = NULL;
-       info->role = ELM_ATSPI_ROLE_UNKNOWN;
-       info->clicked_cb = NULL;
-       info->priority = ACCESS_PRIORITY_APP_LAYOUT;
-
-       *list = eina_list_append(*list, info);
+       if (info) {
+               info->is_access_obj = EINA_FALSE;
+               info->target = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(s_info.layout), SIZE_SETTER);
+               info->parent = s_info.layout;
+               info->name = strdup(buf);
+               info->description = NULL;
+               info->role = ELM_ATSPI_ROLE_UNKNOWN;
+               info->clicked_cb = NULL;
+               info->priority = ACCESS_PRIORITY_APP_LAYOUT;
+
+               *list = eina_list_append(*list, info);
+       }
 
        return;
 }
index a193dda79a69b29c7a4bb1091d917fc7d2798c20..709dfb90ed19904101478f586a0f6894c7627cad 100755 (executable)
@@ -190,7 +190,7 @@ static void __page_focus_changed_cb(void *data)
 {
        int i = 0;
        int *focus_unit = (int *)data;
-       if (focus_unit == NULL || *focus_unit < 0) {
+       if (focus_unit == NULL || (*focus_unit) < 0) {
                _E("focus page is wrong");
                return ;
        }
@@ -216,7 +216,7 @@ static void __page_count_changed_cb(void *data)
 {
        int i = 0;
        int *page_cnt = (int *)data;
-       if (page_cnt == NULL || *page_cnt < 0) {
+       if (page_cnt == NULL || (*page_cnt) < 0) {
                _E("page count is wrong");
                return ;
        }
index 4d152b233b6e33ceb302672f7ff6d4d55f1ebfc5..eb253268ccdc346ed39e7ed4ad30a32e9da7bd6f 100755 (executable)
@@ -1721,7 +1721,10 @@ Evas_Object *edit_create_proxy_page(Evas_Object *edit_scroller, Evas_Object *rea
        elm_access_action_cb_set(elm_access_object_get(access_info->target), ELM_ACCESS_ACTION_ACTIVATE, _widget_access_activate_cb, proxy_page);
 
        Evas_Object *remove_focus = elm_button_add(proxy_page_info->page_inner);
-       retv_if(!remove_focus, NULL);
+       if (!remove_focus) {
+               free(access_info);
+               return NULL;
+       }
 
        elm_object_style_set(remove_focus, "focus");
        elm_object_part_content_set(proxy_page_info->page_inner, "remove_focus", remove_focus);
@@ -2829,7 +2832,6 @@ HAPI Evas_Object *_create_left_layout(Evas_Object *layout)
        edit_info = calloc(1, sizeof(edit_info_s));
        if (!edit_info) {
                _E("Cannot calloc for edit_info");
-               free(edit_info);
                return NULL;
        }
        evas_object_data_set(edit, DATA_KEY_EDIT_INFO, edit_info);
index 274970e041eb4e679fb8d4d777d274e45b5700e5..dafccf0225884c2fb214342fbf166bcb52c1b408 100755 (executable)
@@ -535,20 +535,22 @@ static void _noti_detail_view_set_contents(Eina_Bool is_popup)
        if (title_text) {
                buffer_size = strlen(start_tag_title)+strlen(title_text)+strlen(end_tag)+1;
                set_text = (char *)calloc(buffer_size, sizeof(char));
-               snprintf(set_text, buffer_size, "%s%s%s", start_tag_title, title_text, end_tag);
+               if (set_text) {
+                       snprintf(set_text, buffer_size, "%s%s%s", start_tag_title, title_text, end_tag);
 
-               screen_buffer_size += strlen(title_text);
+                       screen_buffer_size += strlen(title_text);
 
-               _noti_detail_view_data_s.title_label = _noti_detail_view_set_label();
-               elm_object_text_set(_noti_detail_view_data_s.title_label, set_text);
-               elm_label_wrap_width_set(_noti_detail_view_data_s.title_label, 268);
-               evas_object_size_hint_max_set(_noti_detail_view_data_s.title_label, 268, -1);
-               _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list,
-                               _noti_detail_view_data_s.title_label);
+                       _noti_detail_view_data_s.title_label = _noti_detail_view_set_label();
+                       elm_object_text_set(_noti_detail_view_data_s.title_label, set_text);
+                       elm_label_wrap_width_set(_noti_detail_view_data_s.title_label, 268);
+                       evas_object_size_hint_max_set(_noti_detail_view_data_s.title_label, 268, -1);
+                       _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list,
+                                       _noti_detail_view_data_s.title_label);
 
-               if (elm_atspi_bridge_utils_is_screen_reader_enabled())
-                       elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.title_label, EINA_FALSE);
-               free(set_text);
+                       if (elm_atspi_bridge_utils_is_screen_reader_enabled())
+                               elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.title_label, EINA_FALSE);
+                       free(set_text);
+               }
        }
 
        if (time) {
@@ -558,38 +560,43 @@ static void _noti_detail_view_set_contents(Eina_Bool is_popup)
                if (text_time) {
                        buffer_size = strlen(start_tag_time)+strlen(text_time)+strlen(end_tag)+1;
                        set_text = (char *)calloc(buffer_size, sizeof(char));
-                       snprintf(set_text, buffer_size, "%s%s%s", start_tag_time, text_time, end_tag);
+                       if (set_text) {
 
-                       screen_buffer_size += strlen(text_time);
+                               snprintf(set_text, buffer_size, "%s%s%s", start_tag_time, text_time, end_tag);
 
-                       _noti_detail_view_data_s.time_label = _noti_detail_view_set_label();
-                       elm_object_text_set(_noti_detail_view_data_s.time_label, set_text);
-                       _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list,
-                                       _noti_detail_view_data_s.time_label);
+                               screen_buffer_size += strlen(text_time);
 
-                       if (elm_atspi_bridge_utils_is_screen_reader_enabled())
-                               elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.time_label, EINA_FALSE);
+                               _noti_detail_view_data_s.time_label = _noti_detail_view_set_label();
+                               elm_object_text_set(_noti_detail_view_data_s.time_label, set_text);
+                               _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list,
+                                               _noti_detail_view_data_s.time_label);
 
-                       free(set_text);
+                               if (elm_atspi_bridge_utils_is_screen_reader_enabled())
+                                       elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.time_label, EINA_FALSE);
+
+                               free(set_text);
+                       }
                }
        }
 
        if (content_title_text) {
                buffer_size = strlen(start_tag)+strlen(content_title_text)+strlen(end_tag)+1;
                set_text = (char *)calloc(buffer_size, sizeof(char));
-               snprintf(set_text, buffer_size, "%s%s%s", start_tag, content_title_text, end_tag);
+               if (set_text) {
+                       snprintf(set_text, buffer_size, "%s%s%s", start_tag, content_title_text, end_tag);
 
-               screen_buffer_size += strlen(content_title_text);
+                       screen_buffer_size += strlen(content_title_text);
 
-               _noti_detail_view_data_s.contents_title_label = _noti_detail_view_set_label();
-               elm_object_text_set(_noti_detail_view_data_s.contents_title_label, set_text);
-               _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list,
-                               _noti_detail_view_data_s.contents_title_label);
+                       _noti_detail_view_data_s.contents_title_label = _noti_detail_view_set_label();
+                       elm_object_text_set(_noti_detail_view_data_s.contents_title_label, set_text);
+                       _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list,
+                                       _noti_detail_view_data_s.contents_title_label);
 
-               if (elm_atspi_bridge_utils_is_screen_reader_enabled())
-                       elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.contents_title_label, EINA_FALSE);
+                       if (elm_atspi_bridge_utils_is_screen_reader_enabled())
+                               elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.contents_title_label, EINA_FALSE);
 
-               free(set_text);
+                       free(set_text);
+               }
        }
 
        /* Horizontal separator */
@@ -600,39 +607,43 @@ static void _noti_detail_view_set_contents(Eina_Bool is_popup)
        if (content_text) {
                buffer_size = strlen(start_tag)+strlen(content_text)+strlen(end_tag)+1;
                set_text = (char *)calloc(buffer_size, sizeof(char));
-               snprintf(set_text, buffer_size, "%s%s%s", start_tag, content_text, end_tag);
+               if (set_text) {
+                       snprintf(set_text, buffer_size, "%s%s%s", start_tag, content_text, end_tag);
 
-               screen_buffer_size += strlen(content_text);
+                       screen_buffer_size += strlen(content_text);
 
-               _noti_detail_view_data_s.paragraph_label = _noti_detail_view_set_label();
-               elm_object_text_set(_noti_detail_view_data_s.paragraph_label, set_text);
-               evas_object_size_hint_max_set(_noti_detail_view_data_s.paragraph_label, 294, -1);
-               _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list,
-                               _noti_detail_view_data_s.paragraph_label);
+                       _noti_detail_view_data_s.paragraph_label = _noti_detail_view_set_label();
+                       elm_object_text_set(_noti_detail_view_data_s.paragraph_label, set_text);
+                       evas_object_size_hint_max_set(_noti_detail_view_data_s.paragraph_label, 294, -1);
+                       _noti_detail_view_data_s.item_list = eina_list_append(_noti_detail_view_data_s.item_list,
+                                       _noti_detail_view_data_s.paragraph_label);
 
-               if (elm_atspi_bridge_utils_is_screen_reader_enabled())
-                       elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.paragraph_label, EINA_FALSE);
+                       if (elm_atspi_bridge_utils_is_screen_reader_enabled())
+                               elm_atspi_accessible_can_highlight_set(_noti_detail_view_data_s.paragraph_label, EINA_FALSE);
 
-               free(set_text);
+                       free(set_text);
+               }
        }
 
        _noti_detail_view_data_s.up_screen_text = (char *)calloc(screen_buffer_size+1+6, sizeof(char));
-       if (title_text) {
-               strncat(_noti_detail_view_data_s.up_screen_text, title_text, strlen(title_text));
-               strncat(_noti_detail_view_data_s.up_screen_text, ". ", 2);
-       }
-       if (text_time) {
-               strncat(_noti_detail_view_data_s.up_screen_text, text_time, strlen(text_time));
-               strncat(_noti_detail_view_data_s.up_screen_text, ". ", 2);
-       }
-       if (content_title_text) {
-               strncat(_noti_detail_view_data_s.up_screen_text, content_title_text, strlen(content_title_text));
-               strncat(_noti_detail_view_data_s.up_screen_text, ". ", 2);
-       }
-       if (content_text)
-               strncat(_noti_detail_view_data_s.up_screen_text, content_text, strlen(content_text));
+       if (_noti_detail_view_data_s.up_screen_text) {
+               if (title_text) {
+                       strncat(_noti_detail_view_data_s.up_screen_text, title_text, strlen(title_text));
+                       strncat(_noti_detail_view_data_s.up_screen_text, ". ", 2);
+               }
+               if (text_time) {
+                       strncat(_noti_detail_view_data_s.up_screen_text, text_time, strlen(text_time));
+                       strncat(_noti_detail_view_data_s.up_screen_text, ". ", 2);
+               }
+               if (content_title_text) {
+                       strncat(_noti_detail_view_data_s.up_screen_text, content_title_text, strlen(content_title_text));
+                       strncat(_noti_detail_view_data_s.up_screen_text, ". ", 2);
+               }
+               if (content_text)
+                       strncat(_noti_detail_view_data_s.up_screen_text, content_text, strlen(content_text));
 
-       free(text_time);
+               free(text_time);
+       }
 
        Evas_Object *bottom_spacer = _noti_create_detail_view_item_layout("detail_bottom_space");
        ret_if(!bottom_spacer);
index 87ad7cb737d3f420b362e4c291c234150f6f0b4d..5340e201d742ea645a84fa79d94c0f5d618ba482 100755 (executable)
@@ -263,18 +263,20 @@ int noti_small_popup_view_create(notification_h notification)
                        screen_buffer_size += strlen(app_name);
 
                screen_text = (char *)calloc(screen_buffer_size+5, sizeof(char));
-
-               if (app_name) {
-                       strncat(screen_text, app_name, strlen(app_name));
-                       strncat(screen_text, ". ", 2);
-               }
-               if (main_text) {
-                       strncat(screen_text, main_text, strlen(main_text));
-                       strncat(screen_text, ". ", 2);
+               if (screen_text) {
+
+                       if (app_name) {
+                               strncat(screen_text, app_name, strlen(app_name));
+                               strncat(screen_text, ". ", 2);
+                       }
+                       if (main_text) {
+                               strncat(screen_text, main_text, strlen(main_text));
+                               strncat(screen_text, ". ", 2);
+                       }
+
+                       elm_atspi_bridge_utils_say(screen_text, EINA_FALSE, NULL, NULL);
+                       free(screen_text);
                }
-
-               elm_atspi_bridge_utils_say(screen_text, EINA_FALSE, NULL, NULL);
-               free(screen_text);
        }
 
        /* Show notification window */