aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-11-15 16:06:57 +0800
committerMilan Crha <mcrha@redhat.com>2013-11-15 16:06:57 +0800
commit570c6374806d0f1ec59cf7a72543efe6b5b637be (patch)
treec5390b1fcb73f30c28bf37168add9bf1dc622b42 /libemail-engine
parent1be51f232560f864ba8795a38e55d472b5b0e2b3 (diff)
downloadgsoc2013-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 'libemail-engine')
-rw-r--r--libemail-engine/e-mail-session.c2
-rw-r--r--libemail-engine/e-mail-utils.c6
-rw-r--r--libemail-engine/mail-folder-cache.c11
-rw-r--r--libemail-engine/mail-mt.c2
4 files changed, 12 insertions, 9 deletions
diff --git a/libemail-engine/e-mail-session.c b/libemail-engine/e-mail-session.c
index 38eae7791d..23ed2ce4de 100644
--- a/libemail-engine/e-mail-session.c
+++ b/libemail-engine/e-mail-session.c
@@ -190,7 +190,7 @@ user_message_response_cb (GObject *source,
}
/* waiting for a response? */
- if (m && m->button_captions)
+ if (m->button_captions)
e_flag_set (m->done);
/* check for pendings */
diff --git a/libemail-engine/e-mail-utils.c b/libemail-engine/e-mail-utils.c
index d4bb9b5050..9610da7419 100644
--- a/libemail-engine/e-mail-utils.c
+++ b/libemail-engine/e-mail-utils.c
@@ -86,8 +86,6 @@ em_utils_folder_is_drafts (ESourceRegistry *registry,
folder_uri = e_mail_folder_uri_from_folder (folder);
- store = camel_folder_get_parent_store (folder);
-
extension_name = E_SOURCE_EXTENSION_MAIL_COMPOSITION;
list = e_source_registry_list_sources (registry, extension_name);
@@ -157,8 +155,6 @@ em_utils_folder_is_templates (ESourceRegistry *registry,
folder_uri = e_mail_folder_uri_from_folder (folder);
- store = camel_folder_get_parent_store (folder);
-
extension_name = E_SOURCE_EXTENSION_MAIL_COMPOSITION;
list = e_source_registry_list_sources (registry, extension_name);
@@ -227,8 +223,6 @@ em_utils_folder_is_sent (ESourceRegistry *registry,
folder_uri = e_mail_folder_uri_from_folder (folder);
- store = camel_folder_get_parent_store (folder);
-
extension_name = E_SOURCE_EXTENSION_MAIL_SUBMISSION;
list = e_source_registry_list_sources (registry, extension_name);
diff --git a/libemail-engine/mail-folder-cache.c b/libemail-engine/mail-folder-cache.c
index e54cdbb09c..672447c57e 100644
--- a/libemail-engine/mail-folder-cache.c
+++ b/libemail-engine/mail-folder-cache.c
@@ -32,6 +32,7 @@
#include <config.h>
#endif
+#include <errno.h>
#include <string.h>
#include <time.h>
@@ -1152,12 +1153,18 @@ rename_folders (MailFolderCache *cache,
e_filename_make_safe (newuri);
oldfile = g_strdup_printf ("%s/custom_view-%s.xml", config_dir, olduri);
newfile = g_strdup_printf ("%s/custom_view-%s.xml", config_dir, newuri);
- g_rename (oldfile, newfile);
+ if (g_rename (oldfile, newfile) == -1) {
+ g_warning ("%s: Failed to rename '%s' to '%s': %s", G_STRFUNC,
+ oldfile, newfile, g_strerror (errno));
+ }
g_free (oldfile);
g_free (newfile);
oldfile = g_strdup_printf ("%s/current_view-%s.xml", config_dir, olduri);
newfile = g_strdup_printf ("%s/current_view-%s.xml", config_dir, newuri);
- g_rename (oldfile, newfile);
+ if (g_rename (oldfile, newfile) == -1) {
+ g_warning ("%s: Failed to rename '%s' to '%s': %s", G_STRFUNC,
+ oldfile, newfile, g_strerror (errno));
+ }
g_free (oldfile);
g_free (newfile);
g_free (olduri);
diff --git a/libemail-engine/mail-mt.c b/libemail-engine/mail-mt.c
index 19ed41b0dc..96f8e7267f 100644
--- a/libemail-engine/mail-mt.c
+++ b/libemail-engine/mail-mt.c
@@ -655,6 +655,8 @@ mail_call_main (mail_call_t type,
ret = m->ret;
mail_msg_unref (m);
+ /* the m->ap is freed on the message end, at do_free() above */
+ /* coverity[missing_va_end] */
return ret;
}