Changeset 356:2d58361dd5a7
- Timestamp:
- 1998-08-20 01:34:11 (10 years ago)
- Author:
- Thomas Roessler <roessler@…>
- Branch:
- mutt-0-94
- Message:
-
When you forward a message with $mime_forward set, or when
you attach a message with the "attach-message" command
from the "compose" menu, there is a memory leak. The real
reason for this leak is that multipart attachments are not
supported in the "compose" menu, so you need to go through
quite a few contortions in order to handle message/rfc822
attachments. Consequently, the patch below is just an
ugly hack. (From: Liviu Daia)
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r315
|
r356
|
|
| 646 | 646 | STATE s; |
| 647 | 647 | unsigned int saved_encoding = 0; |
| | 648 | BODY *saved_parts = NULL; |
| | 649 | HEADER *saved_hdr = NULL; |
| 648 | 650 | |
| 649 | 651 | memset (&s, 0, sizeof (s)); |
| … |
… |
|
| 684 | 686 | m->offset = 0; |
| 685 | 687 | if (mutt_is_message_type(m->type, m->subtype)) |
| | 688 | { |
| | 689 | saved_parts = m->parts; |
| | 690 | saved_hdr = m->hdr; |
| 686 | 691 | m->parts = mutt_parse_messageRFC822 (s.fpin, m); |
| | 692 | } |
| 687 | 693 | } |
| 688 | 694 | else |
| … |
… |
|
| 696 | 702 | m->length = 0; |
| 697 | 703 | m->encoding = saved_encoding; |
| 698 | | if (m->parts) |
| 699 | | mutt_free_body (&m->parts); |
| | 704 | if (saved_parts) |
| | 705 | { |
| | 706 | mutt_free_header (&m->hdr); |
| | 707 | m->parts = saved_parts; |
| | 708 | m->hdr = saved_hdr; |
| | 709 | } |
| 700 | 710 | fclose (s.fpin); |
| 701 | 711 | } |
-
|
r352
|
r356
|
|
| 944 | 944 | rewind(fp); |
| 945 | 945 | |
| 946 | | body->hdr = mutt_new_header(); |
| | 946 | body->hdr = mutt_new_header(); |
| 947 | 947 | body->hdr->offset = 0; |
| 948 | | body->hdr->env = mutt_read_rfc822_header(fp, body->hdr); |
| | 948 | body->hdr->env = mutt_read_rfc822_header(fp, body->hdr); |
| 949 | 949 | mutt_update_encoding (body); |
| | 950 | body->parts = body->hdr->content; |
| 950 | 951 | |
| 951 | 952 | fclose(fp); |