diff options
author | Larry Ewing <lewing@ximian.com> | 2001-10-10 15:12:25 +0800 |
---|---|---|
committer | Larry Ewing <lewing@src.gnome.org> | 2001-10-10 15:12:25 +0800 |
commit | e42c544568d0f4aadc5547315ad0baf932f0dea7 (patch) | |
tree | 8056f60cee491357ac90e6dd9331c4ef28fd202d | |
parent | 7ce7e097622ccf0a2946abd35a4f02c5dbb9e42e (diff) | |
download | gsoc2013-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
-rw-r--r-- | mail/ChangeLog | 5 | ||||
-rw-r--r-- | mail/mail-display.c | 7 |
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)); |