Fix leak in modest-tny-msg
authorAlberto Garcia <agarcia@igalia.com>
Wed, 12 Dec 2007 17:11:18 +0000 (17:11 +0000)
committerAlberto Garcia <agarcia@igalia.com>
Wed, 12 Dec 2007 17:11:18 +0000 (17:11 +0000)
pmo-trunk-r3903

src/modest-tny-msg.c

index 263b859..63dfd02 100644 (file)
@@ -101,6 +101,8 @@ modest_tny_msg_new (const gchar* mailto, const gchar* from, const gchar *cc,
        /* Add attachments */
        if (attachments)
                add_attachments (TNY_MIME_PART (new_msg), attachments, FALSE);
+       if (header)
+               g_object_unref(header);
 
        return new_msg;
 }
@@ -150,6 +152,8 @@ modest_tny_msg_new_html_plain (const gchar* mailto, const gchar* from, const gch
        /* Add attachments */
        add_attachments (TNY_MIME_PART (new_msg), attachments, FALSE);
        add_images (new_msg, images);
+       if (header)
+               g_object_unref(header);
 
        return new_msg;
 }