X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=copy.c;h=d312d468b080be2fcf48b7e94e9d0e3ab6725e3e;hb=8e037c67a88cb4680c4391134c578e3b55a80f8a;hp=48dcabb300c21bb2f2825b2da4003235b635394d;hpb=ef7b80006ebb47372d69c64e8b2b2f0764333d55;p=apps%2Fmadmutt.git diff --git a/copy.c b/copy.c index 48dcabb..d312d46 100644 --- a/copy.c +++ b/copy.c @@ -11,6 +11,8 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "ascii.h" #include "handler.h" @@ -157,7 +159,7 @@ mutt_copy_hdr (FILE* in, FILE* out, off_t off_start, off_t off_end, mem_realloc (&headers[x], str_len (headers[x]) + str_len (this_one) + sizeof (char)); strcat (headers[x], this_one); /* __STRCAT_CHECKED__ */ - mem_free (&this_one); + p_delete(&this_one); } this_one = NULL; @@ -250,7 +252,7 @@ mutt_copy_hdr (FILE* in, FILE* out, off_t off_start, off_t off_end, mem_realloc (&headers[x], str_len (headers[x]) + str_len (this_one) + sizeof (char)); strcat (headers[x], this_one); /* __STRCAT_CHECKED__ */ - mem_free (&this_one); + p_delete(&this_one); } this_one = NULL; @@ -303,8 +305,8 @@ mutt_copy_hdr (FILE* in, FILE* out, off_t off_start, off_t off_end, /* Free in a separate loop to be sure that all headers are freed * in case of error. */ for (x = 0; x < hdr_count; x++) - mem_free (&headers[x]); - mem_free (&headers); + p_delete(&headers[x]); + p_delete(&headers); if (error) return (-1); @@ -390,7 +392,7 @@ mutt_copy_header (FILE * in, HEADER * h, FILE * out, int flags, /* Mutt stores references in reverse order, thus we create * a reordered refs list that we can put in the headers */ for (; listp; listp = listp->next, refs = t) { - t = (LIST *) mem_malloc (sizeof (LIST)); + t = p_new(LIST, 1); t->data = listp->data; t->next = refs; } @@ -401,7 +403,7 @@ mutt_copy_header (FILE * in, HEADER * h, FILE * out, int flags, /* clearing refs from memory */ for (t = refs; refs; refs = t->next, t = refs) - mem_free (&refs); + p_delete(&refs); if (fputc ('\n', out) == EOF) return (-1); @@ -944,6 +946,6 @@ static int address_header_decode (char **h) rfc822_free_address (&a); - mem_free (&s); + p_delete(&s); return 1; }