From e42c544568d0f4aadc5547315ad0baf932f0dea7 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Wed, 10 Oct 2001 07:12:25 +0000 Subject: copy the data. We can't ref the byte array and we can't free it so we have 2001-10-10 Larry Ewing * 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 --- mail/mail-display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mail/mail-display.c') 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)); -- cgit v1.2.3