# include "config.h"
#endif
+#include <lib-lib/mem.h>
+
#include "mutt.h"
#include "ascii.h"
#include "handler.h"
debug_print (1, ("WEED is %s\n", (flags & CH_WEED) ? "Set" : "Not"));
- headers = mem_calloc (hdr_count, sizeof (char *));
+ headers = p_new(char *, hdr_count);
/* Read all the headers into the array */
while (ftello (in) < 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;
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;
/* 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);
/* 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;
}
/* 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);
mutt_addrlist_to_local (a);
rfc2047_decode_adrlist (a);
- *h = mem_calloc (1, l + 2);
-
- strfcpy (*h, s, l + 1);
+ *h = p_dupstr(s, l + 1);
format_address_header (h, a);
rfc822_free_address (&a);
- mem_free (&s);
+ p_delete(&s);
return 1;
}