X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=imap%2Fimap.c;h=3f988e83cf62ceda243394114e534fe41a4bc0c0;hp=8c7cc5e562f6801266ab589d9fa19e473ccaab0e;hb=b3cb6ed8d36c550a2e589910ce51bbc8352ff57c;hpb=8e037c67a88cb4680c4391134c578e3b55a80f8a diff --git a/imap/imap.c b/imap/imap.c index 8c7cc5e..3f988e8 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -692,8 +692,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 +816,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;