* Partially fixes NB#81238, fixes some problems reported by coverity
authorSergio Villar Senin <svillar@igalia.com>
Tue, 26 Feb 2008 18:23:18 +0000 (18:23 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Tue, 26 Feb 2008 18:23:18 +0000 (18:23 +0000)
pmo-trunk-r4231

src/modest-tny-msg.c
src/widgets/modest-attachments-view.c

index f711496..a5be76f 100644 (file)
@@ -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);
 
        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);
        }
                g_list_foreach (attachments_list, (GFunc) g_object_unref, NULL);
                g_list_free (attachments_list);
        }
index a6b447c..d144c37 100644 (file)
@@ -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);
                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;
                        application_multipart = TRUE;
-               
+                       g_free (header_content_type_lower);
+               }
                g_free (header_content_type);
                g_free (header_content_type);
-               g_free (header_content_type_lower);
+
                if (application_multipart) {
                        gtk_widget_queue_draw (GTK_WIDGET (attachments_view));
                        return;
                if (application_multipart) {
                        gtk_widget_queue_draw (GTK_WIDGET (attachments_view));
                        return;