aboutsummaryrefslogtreecommitdiffstats
path: root/em-format
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-11-30 22:29:34 +0800
committerMilan Crha <mcrha@redhat.com>2012-11-30 22:30:45 +0800
commitab3f65a15e1b6fe5bdf488e6e879899e283ccc43 (patch)
treeac594d423506e1fa1d47fbf057a1ec71947bf7a5 /em-format
parent1eb7481305d0feda31538d072c206aab5dbdeabd (diff)
downloadgsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar.gz
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar.bz2
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar.lz
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar.xz
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.tar.zst
gsoc2013-evolution-ab3f65a15e1b6fe5bdf488e6e879899e283ccc43.zip
Address couple issues found by a Coverity scan
Diffstat (limited to 'em-format')
-rw-r--r--em-format/e-mail-formatter-message-rfc822.c2
-rw-r--r--em-format/e-mail-formatter.c8
-rw-r--r--em-format/e-mail-parser.c2
-rw-r--r--em-format/e-mail-part-utils.c1
4 files changed, 9 insertions, 4 deletions
diff --git a/em-format/e-mail-formatter-message-rfc822.c b/em-format/e-mail-formatter-message-rfc822.c
index 614efca6df..50e3a7bec7 100644
--- a/em-format/e-mail-formatter-message-rfc822.c
+++ b/em-format/e-mail-formatter-message-rfc822.c
@@ -87,7 +87,7 @@ emfe_message_rfc822_format (EMailFormatterExtension *extension,
iter = e_mail_part_list_get_iter (context->parts, part->id);
end = g_strconcat (part->id, ".end", NULL);
- for (iter = iter->next; iter; iter = g_slist_next (iter)) {
+ for (iter = g_slist_next (iter); iter; iter = g_slist_next (iter)) {
EMailPart * p = iter->data;
if (!p)
continue;
diff --git a/em-format/e-mail-formatter.c b/em-format/e-mail-formatter.c
index 7d0f589b8a..9ac8cf7678 100644
--- a/em-format/e-mail-formatter.c
+++ b/em-format/e-mail-formatter.c
@@ -169,6 +169,9 @@ mail_formatter_run (EMailFormatter *formatter,
iter = iter->next;
} while (iter);
+
+ if (!iter)
+ break;
}
}
}
@@ -845,8 +848,9 @@ e_mail_formatter_format (EMailFormatter *formatter,
g_simple_async_result_set_check_cancellable (simple, cancellable);
- if (!parts && callback) {
- callback (G_OBJECT (formatter), G_ASYNC_RESULT (simple), user_data);
+ if (!parts) {
+ if (callback)
+ callback (G_OBJECT (formatter), G_ASYNC_RESULT (simple), user_data);
g_object_unref (simple);
return;
}
diff --git a/em-format/e-mail-parser.c b/em-format/e-mail-parser.c
index 8f007a07f7..608bc467da 100644
--- a/em-format/e-mail-parser.c
+++ b/em-format/e-mail-parser.c
@@ -466,7 +466,7 @@ e_mail_parser_parse_part_as (EMailParser *parser,
GList *iter;
EMailExtensionRegistry *reg;
EMailParserClass *parser_class;
- GSList *part_list;
+ GSList *part_list = NULL;
gchar *as_mime_type;
if (g_cancellable_is_cancelled (cancellable))
diff --git a/em-format/e-mail-part-utils.c b/em-format/e-mail-part-utils.c
index b1c514d49e..6f8013d7a8 100644
--- a/em-format/e-mail-part-utils.c
+++ b/em-format/e-mail-part-utils.c
@@ -444,6 +444,7 @@ e_mail_part_build_uri (CamelFolder *folder,
}
default:
g_warning ("Invalid param type %s", g_type_name (type));
+ va_end (ap);
return NULL;
}