From: Sergio Villar Senin Date: Tue, 17 Mar 2009 19:29:45 +0000 (+0000) Subject: Fixed leak 3/26 X-Git-Tag: git_migration_finished~296 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=1a265d71e544afc25fde77bba48ac02cb78cae5b Fixed leak 3/26 pmo-trunk-r8108 --- diff --git a/src/hildon2/modest-msg-view-window.c b/src/hildon2/modest-msg-view-window.c index a148f89..d8526de 100644 --- a/src/hildon2/modest-msg-view-window.c +++ b/src/hildon2/modest-msg-view-window.c @@ -2482,15 +2482,13 @@ modest_msg_view_window_view_attachment (ModestMsgViewWindow *window, g_object_unref (selected_attachments); if (error) - return; + goto frees; } else { g_object_ref (mime_part); } - if (tny_mime_part_is_purged (mime_part)) { - g_object_unref (mime_part); - return; - } + if (tny_mime_part_is_purged (mime_part)) + goto frees; if (!modest_tny_mime_part_is_msg (mime_part)) { gchar *filepath = NULL; @@ -2552,7 +2550,12 @@ modest_msg_view_window_view_attachment (ModestMsgViewWindow *window, gtk_widget_show_all (GTK_WIDGET (msg_win)); } } - g_object_unref (mime_part); + + frees: + if (attachment_uid) + g_free (attachment_uid); + if (mime_part) + g_object_unref (mime_part); } typedef struct