From 9a9ecea6b1a504e538117aa5a7b573c32fe259ed Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Tue, 26 Feb 2008 18:23:18 +0000 Subject: [PATCH] * Partially fixes NB#81238, fixes some problems reported by coverity pmo-trunk-r4231 --- src/modest-tny-msg.c | 2 +- src/widgets/modest-attachments-view.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/modest-tny-msg.c b/src/modest-tny-msg.c index f711496..a5be76f 100644 --- a/src/modest-tny-msg.c +++ b/src/modest-tny-msg.c @@ -809,7 +809,7 @@ modest_tny_msg_create_reply_msg (TnyMsg *msg, new_msg = create_reply_forward_mail (msg, header, from, signature, TRUE, reply_type, attachments_list); - if (attachments_list) { + if (attachments_list != NULL) { g_list_foreach (attachments_list, (GFunc) g_object_unref, NULL); g_list_free (attachments_list); } diff --git a/src/widgets/modest-attachments-view.c b/src/widgets/modest-attachments-view.c index a6b447c..d144c37 100644 --- a/src/widgets/modest-attachments-view.c +++ b/src/widgets/modest-attachments-view.c @@ -135,13 +135,16 @@ modest_attachments_view_set_message (ModestAttachmentsView *attachments_view, Tn gboolean application_multipart = FALSE; header_content_type = modest_tny_mime_part_get_header_value (TNY_MIME_PART (priv->msg), "Content-Type"); header_content_type = g_strstrip (header_content_type); - header_content_type_lower = header_content_type?g_ascii_strdown (header_content_type, -1):NULL; + header_content_type_lower = (header_content_type ) ? + g_ascii_strdown (header_content_type, -1) : NULL; - if (!strstr (header_content_type_lower, "application/")) + if ((header_content_type_lower != NULL) && + !strstr (header_content_type_lower, "application/")) { application_multipart = TRUE; - + g_free (header_content_type_lower); + } g_free (header_content_type); - g_free (header_content_type_lower); + if (application_multipart) { gtk_widget_queue_draw (GTK_WIDGET (attachments_view)); return; -- 1.7.9.5