* fix some coverity warnings (bug NB#80246, the modest part)
authorDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Tue, 5 Feb 2008 07:50:41 +0000 (07:50 +0000)
committerDirk-Jan C. Binnema <dirk-jan.binnema@nokia.com>
Tue, 5 Feb 2008 07:50:41 +0000 (07:50 +0000)
pmo-trunk-r4135

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

index 4c3efb3..7baff77 100644 (file)
@@ -741,11 +741,8 @@ modest_mail_operation_create_msg (ModestMailOperation *self,
                                  ModestMailOperationCreateMsgCallback callback,
                                  gpointer userdata)
 {
                                  ModestMailOperationCreateMsgCallback callback,
                                  gpointer userdata)
 {
-       ModestMailOperationPrivate *priv;
        CreateMsgInfo *info = NULL;
 
        CreateMsgInfo *info = NULL;
 
-       priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
-
        info = g_slice_new0 (CreateMsgInfo);
        info->mail_op = g_object_ref (self);
 
        info = g_slice_new0 (CreateMsgInfo);
        info->mail_op = g_object_ref (self);
 
@@ -2916,6 +2913,8 @@ modest_mail_operation_refresh_folder  (ModestMailOperation *self,
        state->total = 0;
        g_signal_emit (G_OBJECT (self), signals[PROGRESS_CHANGED_SIGNAL], 
                        0, state, NULL);
        state->total = 0;
        g_signal_emit (G_OBJECT (self), signals[PROGRESS_CHANGED_SIGNAL], 
                        0, state, NULL);
+
+       /* FIXME: we're leaking the state here, or? valgrind thinks so */
        
        tny_folder_refresh_async (folder,
                                  on_refresh_folder,
        
        tny_folder_refresh_async (folder,
                                  on_refresh_folder,
index d8fe96a..48b2108 100644 (file)
@@ -775,12 +775,9 @@ modest_tny_msg_create_reply_msg (TnyMsg *msg,
 
        g_return_val_if_fail (msg && TNY_IS_MSG(msg), NULL);
        
 
        g_return_val_if_fail (msg && TNY_IS_MSG(msg), NULL);
        
-       /* Add attachments */
-       if (msg != NULL) {
-               parts = TNY_LIST (tny_simple_list_new());
-               tny_mime_part_get_parts (TNY_MIME_PART (msg), parts);
-               tny_list_foreach (parts, add_if_attachment, &attachments_list);
-       }
+       parts = TNY_LIST (tny_simple_list_new());
+       tny_mime_part_get_parts (TNY_MIME_PART (msg), parts);
+       tny_list_foreach (parts, add_if_attachment, &attachments_list);
 
        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);
index 557fc88..04742ad 100644 (file)
@@ -801,7 +801,7 @@ modest_attachments_view_get_sizes (ModestAttachmentsView *attachments_view,
 
                if (!tny_mime_part_is_purged (part)) {
                        guint64 size;
 
                if (!tny_mime_part_is_purged (part)) {
                        guint64 size;
-                       *attachments_count ++;
+                       (*attachments_count) ++;
                        size = modest_attachment_view_get_size (MODEST_ATTACHMENT_VIEW (att_view));
                        if (size == 0) {
                                /* we do a random estimation of the size of an attachment */
                        size = modest_attachment_view_get_size (MODEST_ATTACHMENT_VIEW (att_view));
                        if (size == 0) {
                                /* we do a random estimation of the size of an attachment */