X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=imap%2Fimap.c;h=7ead95ae97b5b25a7fbc6a37fdd5693357c93749;hb=1dc7032b59cc5b91d70076ed228bda8caf65a7f3;hp=8c7cc5e562f6801266ab589d9fa19e473ccaab0e;hpb=8e037c67a88cb4680c4391134c578e3b55a80f8a;p=apps%2Fmadmutt.git diff --git a/imap/imap.c b/imap/imap.c index 8c7cc5e..7ead95a 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -31,8 +31,7 @@ #endif #include "buffy.h" -#include "lib/mem.h" -#include "lib/intl.h" +#include #include "lib/str.h" #include "lib/debug.h" @@ -692,8 +691,8 @@ int imap_open_mailbox (CONTEXT * ctx) } ctx->hdrmax = count; - ctx->hdrs = mem_calloc (count, sizeof (HEADER *)); - ctx->v2r = mem_calloc (count, sizeof (int)); + ctx->hdrs = p_new(HEADER *, count); + ctx->v2r = p_new(int, count); ctx->msgcount = 0; if (count && (imap_read_headers (idata, 0, count - 1) < 0)) { mutt_error _("Error opening mailbox"); @@ -816,8 +815,7 @@ int imap_make_msg_set (IMAP_DATA * idata, BUFFER * buf, int flag, int changed) int started = 0; /* make copy of header pointers to sort in natural order */ - hdrs = mem_calloc (idata->ctx->msgcount, sizeof (HEADER *)); - memcpy (hdrs, idata->ctx->hdrs, idata->ctx->msgcount * sizeof (HEADER *)); + hdrs = p_dup(idata->ctx->hdrs, idata->ctx->msgcount); if (Sort != SORT_ORDER) { oldsort = Sort;