Fixed leak 3/26
authorSergio Villar Senin <svillar@igalia.com>
Tue, 17 Mar 2009 19:29:45 +0000 (19:29 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Tue, 17 Mar 2009 19:29:45 +0000 (19:29 +0000)
pmo-trunk-r8108

src/hildon2/modest-msg-view-window.c

index a148f89..d8526de 100644 (file)
@@ -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