From ab3f65a15e1b6fe5bdf488e6e879899e283ccc43 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 30 Nov 2012 15:29:34 +0100 Subject: Address couple issues found by a Coverity scan --- mail/e-mail-account-store.c | 4 ++-- mail/em-folder-tree.c | 2 +- mail/em-folder-utils.c | 2 ++ mail/message-list.c | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) (limited to 'mail') diff --git a/mail/e-mail-account-store.c b/mail/e-mail-account-store.c index acbce1f20c..8d8f867312 100644 --- a/mail/e-mail-account-store.c +++ b/mail/e-mail-account-store.c @@ -1251,7 +1251,7 @@ e_mail_account_store_enable_service (EMailAccountStore *store, CamelService *service) { GtkTreeIter iter; - gboolean proceed; + gboolean proceed = FALSE; g_return_if_fail (E_IS_MAIL_ACCOUNT_STORE (store)); g_return_if_fail (CAMEL_IS_SERVICE (service)); @@ -1279,7 +1279,7 @@ e_mail_account_store_disable_service (EMailAccountStore *store, CamelService *service) { GtkTreeIter iter; - gboolean proceed; + gboolean proceed = FALSE; g_return_if_fail (E_IS_MAIL_ACCOUNT_STORE (store)); g_return_if_fail (CAMEL_IS_SERVICE (service)); diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 615857eda1..7793f877d0 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -1912,7 +1912,7 @@ tree_drag_data_get (GtkWidget *widget, CamelFolder *folder; CamelStore *store; GtkTreeIter iter; - gchar *folder_name; + gchar *folder_name = NULL; gchar *folder_uri; if (!priv->drag_row || !(src_path = diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index d689c5c2bc..c211c03c44 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -634,6 +634,8 @@ em_folder_utils_create_folder (GtkWindow *parent, goto exit; } + g_return_if_fail (folder_name != NULL); + /* HACK: we need to create vfolders using the vfolder editor */ if (CAMEL_IS_VEE_STORE (store)) { EFilterRule *rule; diff --git a/mail/message-list.c b/mail/message-list.c index 959193a653..473cc4faec 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -3568,7 +3568,7 @@ build_subtree_diff (MessageList *ml, /* bigger run of old nodes - must be nodes to remove */ if (ai) { at = ap; - while (at != ai) { + while (at != NULL && at != ai) { t (printf ("removing old node 0\n")); tmp = e_tree_model_node_get_next (etm, at); remove_node_diff (ml, at, 0); @@ -4732,7 +4732,7 @@ regen_list_exec (struct _regen_list_msg *m, } /* camel_folder_summary_prepare_fetch_all (m->folder->summary, NULL); */ - if (!g_cancellable_is_cancelled (cancellable)) { + if (!g_cancellable_is_cancelled (cancellable) && uids) { /* update/build a new tree */ if (m->dotree) { ml_sort_uids_by_tree (m->ml, uids, cancellable); -- cgit