aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-display.c
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2001-10-10 15:12:25 +0800
committerLarry Ewing <lewing@src.gnome.org>2001-10-10 15:12:25 +0800
commite42c544568d0f4aadc5547315ad0baf932f0dea7 (patch)
tree8056f60cee491357ac90e6dd9331c4ef28fd202d /mail/mail-display.c
parent7ce7e097622ccf0a2946abd35a4f02c5dbb9e42e (diff)
downloadgsoc2013-evolution-e42c544568d0f4aadc5547315ad0baf932f0dea7.tar
gsoc2013-evolution-e42c544568d0f4aadc5547315ad0baf932f0dea7.tar.gz
gsoc2013-evolution-e42c544568d0f4aadc5547315ad0baf932f0dea7.tar.bz2
gsoc2013-evolution-e42c544568d0f4aadc5547315ad0baf932f0dea7.tar.lz
gsoc2013-evolution-e42c544568d0f4aadc5547315ad0baf932f0dea7.tar.xz
gsoc2013-evolution-e42c544568d0f4aadc5547315ad0baf932f0dea7.tar.zst
gsoc2013-evolution-e42c544568d0f4aadc5547315ad0baf932f0dea7.zip
copy the data. We can't ref the byte array and we can't free it so we have
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. svn path=/trunk/; revision=13546
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r--mail/mail-display.c7
1 files changed, 5 insertions, 2 deletions
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));