From 9059badd58480f5ef0612386ffb94b0075c7aede Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Tue, 5 Feb 2008 07:50:41 +0000 Subject: [PATCH] * fix some coverity warnings (bug NB#80246, the modest part) pmo-trunk-r4135 --- src/modest-mail-operation.c | 5 ++--- src/modest-tny-msg.c | 9 +++------ src/widgets/modest-attachments-view.c | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 4c3efb3..7baff77 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -741,11 +741,8 @@ modest_mail_operation_create_msg (ModestMailOperation *self, ModestMailOperationCreateMsgCallback callback, gpointer userdata) { - ModestMailOperationPrivate *priv; CreateMsgInfo *info = NULL; - priv = MODEST_MAIL_OPERATION_GET_PRIVATE(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); + + /* FIXME: we're leaking the state here, or? valgrind thinks so */ tny_folder_refresh_async (folder, on_refresh_folder, diff --git a/src/modest-tny-msg.c b/src/modest-tny-msg.c index d8fe96a..48b2108 100644 --- a/src/modest-tny-msg.c +++ b/src/modest-tny-msg.c @@ -775,12 +775,9 @@ modest_tny_msg_create_reply_msg (TnyMsg *msg, 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); diff --git a/src/widgets/modest-attachments-view.c b/src/widgets/modest-attachments-view.c index 557fc88..04742ad 100644 --- a/src/widgets/modest-attachments-view.c +++ b/src/widgets/modest-attachments-view.c @@ -801,7 +801,7 @@ modest_attachments_view_get_sizes (ModestAttachmentsView *attachments_view, 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 */ -- 1.7.9.5