* src/modest-tny-msg.c (add_attachments): get a copy of old content id
intead of a plain reference, as this may be freed before we use it
for the new attachment.
old_attachment = pos->data;
if (!tny_mime_part_is_purged (old_attachment)) {
old_attachment = pos->data;
if (!tny_mime_part_is_purged (old_attachment)) {
- const gchar *old_cid;
- old_cid = tny_mime_part_get_content_id (old_attachment);
+ gchar *old_cid;
+ old_cid = g_strdup (tny_mime_part_get_content_id (old_attachment));
attachment_part = copy_mime_part (old_attachment, err);
if (attachment_part != NULL) {
if (add_inline) {
attachment_part = copy_mime_part (old_attachment, err);
if (attachment_part != NULL) {
if (add_inline) {
tny_mime_part_set_content_id (attachment_part, old_cid);
g_object_unref (attachment_part);
}
tny_mime_part_set_content_id (attachment_part, old_cid);
g_object_unref (attachment_part);
}