X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mime%2Fmime.c;h=2311083f95c74e159397d65de8b0caa797e7a59e;hp=5eaab58502a4b9ac9faf6e2b620c1b3759bc50e0;hb=05a3bbbe420e4afc76e0eea24ce32f859405dc4a;hpb=4cc118a3b000432ed836cc21518a09b32bc0322f diff --git a/lib-mime/mime.c b/lib-mime/mime.c index 5eaab58..2311083 100644 --- a/lib-mime/mime.c +++ b/lib-mime/mime.c @@ -17,6 +17,10 @@ * Copyright © 2006 Pierre Habouzit */ +#include "mime-types.h" + +#include "mutt.h" + const char MimeSpecials[] = "@.,;:<>[]\\\"()?/= \t"; const char *BodyTypes[] = { @@ -41,3 +45,62 @@ const char *BodyEncodings[] = { "x-uuencoded", }; +void address_wipe(address_t *addr) +{ + p_delete(&addr->personal); + p_delete(&addr->mailbox); + address_delete(&addr->next); +} + +void parameter_wipe(PARAMETER *param) +{ + p_delete(¶m->attribute); + p_delete(¶m->value); + parameter_delete(¶m->next); +} + +void envelope_wipe(ENVELOPE *p) +{ + address_delete(&p->return_path); + address_delete(&p->from); + address_delete(&p->to); + address_delete(&p->cc); + address_delete(&p->bcc); + address_delete(&p->sender); + address_delete(&p->reply_to); + address_delete(&p->mail_followup_to); + + p_delete(&p->list_post); + p_delete(&p->subject); + /* real_subj is just an offset to subject and shouldn't be freed */ + p_delete(&p->message_id); + p_delete(&p->supersedes); + p_delete(&p->date); + p_delete(&p->x_label); + p_delete(&p->organization); +#ifdef USE_NNTP + p_delete(&p->newsgroups); + p_delete(&p->xref); + p_delete(&p->followup_to); + p_delete(&p->x_comment_to); +#endif + + mutt_buffer_free (&p->spam); + mutt_free_list(&p->references); + mutt_free_list(&p->in_reply_to); + mutt_free_list(&p->userhdrs); +} + +void header_wipe(HEADER *h) +{ + envelope_delete(&h->env); + mutt_free_body (&h->content); + p_delete(&h->maildir_flags); + p_delete(&h->tree); + p_delete(&h->path); +#ifdef MIXMASTER + mutt_free_list(&h->chain); +#endif + p_delete(&h->data); +} +