diff options
author | Milan Crha <mcrha@redhat.com> | 2013-11-15 16:06:57 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-11-15 16:06:57 +0800 |
commit | 570c6374806d0f1ec59cf7a72543efe6b5b637be (patch) | |
tree | c5390b1fcb73f30c28bf37168add9bf1dc622b42 /mail/message-list.c | |
parent | 1be51f232560f864ba8795a38e55d472b5b0e2b3 (diff) | |
download | gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.gz gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.bz2 gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.lz gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.xz gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.zst gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.zip |
Fix/mute issues found by Coverity scan
This makes the code free of Coverity scan issues.
It is sometimes quite pedantic and expects/suggests some
coding habits, thus certain changes may look weird, but for a good
thing, I hope. The code is also tagged with Coverity scan
suppressions, to keep the code as is and hide the warning too.
Also note that Coverity treats g_return_if_fail(), g_assert() and
similar macros as unreliable, and it's true these can be disabled
during the compile time, thus it brings in other set of 'weird'
changes.
Diffstat (limited to 'mail/message-list.c')
-rw-r--r-- | mail/message-list.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index 89a473a7ff..b54af0fe68 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -1233,7 +1233,7 @@ thread_select_foreach (ETreePath path, do { last = node; node = node->parent; - } while (!G_NODE_IS_ROOT (node)); + } while (node && !G_NODE_IS_ROOT (node)); g_ptr_array_add (tsi->paths, last); @@ -1719,14 +1719,14 @@ ml_tree_value_at_ex (ETreeModel *etm, /* Extract the single label from the hashtable. */ g_hash_table_iter_init (&iter, ld.labels_tag2iter); - g_hash_table_iter_next (&iter, NULL, (gpointer *) &label_defn); + if (g_hash_table_iter_next (&iter, NULL, (gpointer *) &label_defn)) { + e_mail_label_list_store_get_color (ld.store, label_defn, &colour_val); - e_mail_label_list_store_get_color (ld.store, label_defn, &colour_val); - - /* XXX Hack to avoid returning an allocated string. */ - colour_alloced = gdk_color_to_string (&colour_val); - colour = g_intern_string (colour_alloced); - g_free (colour_alloced); + /* XXX Hack to avoid returning an allocated string. */ + colour_alloced = gdk_color_to_string (&colour_val); + colour = g_intern_string (colour_alloced); + g_free (colour_alloced); + } } else if (camel_message_info_flags (msg_info) & CAMEL_MESSAGE_FLAGGED) { /* FIXME: extract from the important.xpm somehow. */ colour = "#A7453E"; @@ -5412,9 +5412,11 @@ message_list_regen_thread (GSimpleAsyncResult *simple, /* Handle search error or cancellation. */ - if (local_error == NULL) + if (local_error == NULL) { + /* coverity[unchecked_value] */ g_cancellable_set_error_if_cancelled ( cancellable, &local_error); + } if (local_error != NULL) { g_simple_async_result_take_error (simple, local_error); @@ -5506,9 +5508,8 @@ message_list_regen_done_cb (GObject *source_object, activity = regen_data->activity; - g_simple_async_result_propagate_error (simple, &local_error); - - if (e_activity_handle_cancellation (activity, local_error)) { + if (g_simple_async_result_propagate_error (simple, &local_error) && + e_activity_handle_cancellation (activity, local_error)) { g_error_free (local_error); return; |