Changeset 356:2d58361dd5a7

Show
Ignore:
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:
2 modified

Legend:

Unmodified
Added
Removed
  • attach.c

    r315 r356  
    646646  STATE s; 
    647647  unsigned int saved_encoding = 0; 
     648  BODY *saved_parts = NULL; 
     649  HEADER *saved_hdr = NULL; 
    648650 
    649651  memset (&s, 0, sizeof (s)); 
     
    684686    m->offset = 0; 
    685687    if (mutt_is_message_type(m->type, m->subtype)) 
     688    { 
     689      saved_parts = m->parts; 
     690      saved_hdr = m->hdr; 
    686691      m->parts = mutt_parse_messageRFC822 (s.fpin, m); 
     692    } 
    687693  } 
    688694  else 
     
    696702    m->length = 0; 
    697703    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    } 
    700710    fclose (s.fpin); 
    701711  } 
  • sendlib.c

    r352 r356  
    944944  rewind(fp); 
    945945 
    946   body->hdr         = mutt_new_header(); 
     946  body->hdr = mutt_new_header(); 
    947947  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); 
    949949  mutt_update_encoding (body); 
     950  body->parts = body->hdr->content; 
    950951 
    951952  fclose(fp);