* Use the get_folders_async to retrieve the per account outbox (dape's patch)
[modest] / src / widgets / modest-attachments-view.c
index a6b447c..ab549ab 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);
-               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;
@@ -416,6 +419,7 @@ button_press_event (GtkWidget *widget,
                                        priv->rubber_start = att_view;
                                        gtk_grab_add (widget);
                                }
+                               g_object_unref (mime_part);
                        }
                }
        }
@@ -502,6 +506,7 @@ find_prev_or_next_not_purged (GList *list, gboolean prev, gboolean include_this)
                                tmp = g_list_next (tmp);
                        is_valid = FALSE;
                }
+               g_object_unref (mime_part);
        } while (!is_valid && tmp);
 
        return tmp;
@@ -844,6 +849,7 @@ modest_attachments_view_select_all (ModestAttachmentsView *atts_view)
                        gtk_widget_set_state (GTK_WIDGET (node->data), GTK_STATE_SELECTED);
                        priv->selected = g_list_append (priv->selected, node->data);
                }
+               g_object_unref (mime_part);
        }
        g_list_free (children);