X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=recvattach.c;h=6277705e237e6161cdcade3ee816e27a18a31a5c;hp=d0272e331ac3e07c1f4f9ab82e7e73e212e1abc1;hb=ebad7634114993e2e96fa66fda4b705d05832193;hpb=92f33a4a968296528f1d5f151ff700210840cb2c diff --git a/recvattach.c b/recvattach.c index d0272e3..6277705 100644 --- a/recvattach.c +++ b/recvattach.c @@ -12,6 +12,8 @@ # include "config.h" #endif +#include + #include "mutt.h" #include "ascii.h" #include "enter.h" @@ -27,7 +29,6 @@ #include "copy.h" #include "mutt_crypt.h" -#include "lib/mem.h" #include "lib/intl.h" #include "lib/str.h" @@ -62,7 +63,7 @@ static struct mapping_t AttachHelp[] = { static int mutt_extract_path (char *filename, char *path) { - char *tmp = mem_malloc (sizeof (char) * _POSIX_PATH_MAX); + char *tmp = p_new(char, _POSIX_PATH_MAX); char *help_ptr; help_ptr = tmp; @@ -76,7 +77,7 @@ static int mutt_extract_path (char *filename, char *path) } *help_ptr++ = *filename++; } - mem_free (&tmp); + p_delete(&tmp); return 0; } @@ -126,7 +127,7 @@ ATTACHPTR **mutt_gen_attach_list (BODY * m, for (; m; m = m->next) { if (*idxlen == *idxmax) { - mem_realloc (&idx, sizeof (ATTACHPTR *) * ((*idxmax) += 5)); + p_realloc(&idx, (*idxmax) += 5); for (i = *idxlen; i < *idxmax; i++) idx[i] = NULL; } @@ -144,7 +145,7 @@ ATTACHPTR **mutt_gen_attach_list (BODY * m, } else { if (!idx[*idxlen]) - idx[*idxlen] = (ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR)); + idx[*idxlen] = p_new(ATTACHPTR, 1); new = idx[(*idxlen)++]; new->content = m; @@ -550,7 +551,7 @@ void mutt_save_attachment_list (FILE * fp, int tag, BODY * top, HEADER * hdr, break; } - mem_free (&directory); + p_delete(&directory); if (tag && menu) { menu->oldcurrent = menu->current; @@ -1241,12 +1242,12 @@ void mutt_view_attachments (HEADER * hdr) hdr->attach_del = 1; if (idx[idxmax]->content) idx[idxmax]->content->aptr = NULL; - mem_free (&idx[idxmax]->tree); - mem_free (&idx[idxmax]); + p_delete(&idx[idxmax]->tree); + p_delete(&idx[idxmax]); } if (hdr->attach_del) hdr->changed = 1; - mem_free (&idx); + p_delete(&idx); idxmax = 0; if (WithCrypto && need_secured && secured) {