X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fsortm.c;h=ae4038db6c2b3d68211fef3e21b92a7d29766ee1;hp=0d02af9f8985e8662be7088ae960dcd656e425fa;hb=72795bfcbe9f7fee8927b1a4942c0230b0f857a8;hpb=5086954856e7b078981418d4aac233d37deb72bd diff --git a/uip/sortm.c b/uip/sortm.c index 0d02af9..ae4038d 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -197,7 +197,7 @@ main(int argc, char **argv) /* ** sort a list of pointers to our "messages to be sorted". */ - dlist = (struct smsg **) mh_xmalloc((nmsgs+1) * sizeof(*dlist)); + dlist = (struct smsg **) mh_xcalloc((size_t) (nmsgs+1), sizeof(*dlist)); for (i = 0; i < nmsgs; i++) dlist[i] = &smsgs[i]; dlist[nmsgs] = 0; @@ -235,7 +235,7 @@ main(int argc, char **argv) ** the collection of messages with the same subj ** given a message number. */ - il = (struct smsg ***) calloc(mp->hghsel+1, sizeof(*il)); + il = (struct smsg ***) mh_xcalloc(mp->hghsel+1, sizeof(*il)); if (! il) adios(EX_OSERR, NULL, "couldn't allocate msg list"); for (i = 0; i < nmsgs; i++) @@ -295,7 +295,7 @@ read_hdrs(struct msgs *mp, char *datesw) twscopy(&tb, dlocaltimenow()); - smsgs = (struct smsg *) calloc((size_t) (mp->hghsel - mp->lowsel + 2), + smsgs = (struct smsg *) mh_xcalloc((size_t) (mp->hghsel - mp->lowsel + 2), sizeof(*smsgs)); if (smsgs == NULL) adios(EX_OSERR, NULL, "unable to allocate sort storage");