[Email] Fix Svace issues 11/77611/4 submit/tizen/20160630.135928
authorIgor Olshevskyi <i.olshevskyi@samsung.com>
Thu, 30 Jun 2016 09:11:05 +0000 (12:11 +0300)
committerGennadiy Azarov <gen.azarov@samsung.com>
Thu, 30 Jun 2016 11:45:55 +0000 (04:45 -0700)
Change-Id: I5cba4cfc0d998c951aebf28e204b56ff46e90c19

common/src/email-utils-contacts.c
common/src/email-utils.c
modules/setting/src/email-view-account-details-setup.c
modules/setting/src/email-view-account-details.c
modules/viewer/src/email-viewer-reply-toolbar.c

index ca11dfa..3f36295 100644 (file)
@@ -620,9 +620,13 @@ EMAIL_API email_contact_list_info_t *email_contacts_get_contact_info_by_email_id
        if (ret != CONTACTS_ERROR_NONE) {
                debug_warning("contacts_list_get_current_record_p() failed (%d)", ret);
                contacts_list_destroy(person_email_list, true);
+               free(contact_info);
                return NULL;
        }
-       contact_info->email_id = email_id;
+
+       if (contact_info) {
+               contact_info->email_id = email_id;
+       }
        contacts_list_destroy(person_email_list, true);
        debug_leave();
        return contact_info;
index f312c9b..9fb10db 100644 (file)
@@ -2672,7 +2672,10 @@ EMAIL_API Eina_Bool email_file_cp(const char *source, const char *destination)
 
 EMAIL_API char *email_file_dir_get(const char *path)
 {
-       return dirname(strdup(path));
+       char *tmp_path = strdup(path);
+       char *res = strdup(dirname(tmp_path));
+       free(tmp_path);
+       return res;
 }
 
 EMAIL_API Eina_Bool email_file_exists(const char *file)
index 5cac836..7a8b734 100644 (file)
@@ -195,7 +195,7 @@ static int _create(email_view_t *self)
 
        g_vd = view;
 
-       if (account_data->incoming_server_type == EMAIL_SERVER_TYPE_IMAP4)
+       if (account_data && account_data->incoming_server_type == EMAIL_SERVER_TYPE_IMAP4)
                view->is_imap_push_supported = _is_imap_push_supported(account_data);
 
        _create_list(view);
index e88a7ab..cf76c6a 100644 (file)
@@ -260,7 +260,7 @@ static int _create(email_view_t *self)
 
        _create_toolbar_more_btn(view);
 
-       if (account_data->incoming_server_type == EMAIL_SERVER_TYPE_IMAP4)
+       if (account_data && account_data->incoming_server_type == EMAIL_SERVER_TYPE_IMAP4)
                        view->is_imap_push_supported = _is_imap_push_supported(account_data);
 
        _create_list(view);
index faa9c84..0b14dd6 100644 (file)
@@ -284,6 +284,12 @@ static void _reply_toolbar_create_fwd_options_popup(EmailViewerView *view)
        evas_object_data_set(fwd_popup_genlist, VIEWER_EVAS_DATA_NAME, view);
 
        view->fwd_popup_data = MEM_ALLOC(view->fwd_popup_data, 1);
+       if (!view->fwd_popup_data) {
+               debug_error("Failed to allocate memory for fwd_popup_data!");
+               DELETE_EVAS_OBJECT(view->fwd_option_popup);
+               return;
+       }
+
        view->fwd_popup_data->radio_group = elm_radio_add(fwd_popup_genlist);
        elm_radio_value_set(view->fwd_popup_data->radio_group, FWD_NEW_RECIPIENT_INDEX);