aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog5
-rw-r--r--mail/mail-display.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 88df7a3caa..c22dc62018 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,8 @@
+2001-10-10 Larry Ewing <lewing@ximian.com>
+
+ * mail-display.c (save_url): copy the data. We can't ref the byte
+ array and we can't free it so we have to copy it.
+
2001-10-10 <NotZed@Ximian.com>
* mail-ops.c (transfer_messages_transfer): IF the source and
diff --git a/mail/mail-display.c b/mail/mail-display.c
index d673ae3b61..20587f49fe 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -738,8 +738,11 @@ save_url (MailDisplay *md, const char *url)
name = strrchr (url, '/');
name = name ? name : url;
-
- memstream = camel_stream_mem_new_with_byte_array (ba);
+
+ /* we have to copy the data here since the ba may be long gone
+ * by the time the user actually saves the file
+ */
+ memstream = camel_stream_mem_new_with_buffer (ba->data, ba->len);
wrapper = camel_data_wrapper_new ();
camel_data_wrapper_construct_from_stream (wrapper, memstream);
camel_object_unref (CAMEL_OBJECT (memstream));