]> diplodocus.org Git - nmh/blobdiff - uip/sortm.c
Put parameter names in h/utils.h memory function prototypes.
[nmh] / uip / sortm.c
index 3df188592fcb86026b6f7a5c821d44fecd59483d..ff3f35191a8b25bd33428a312342af511e381b73 100644 (file)
@@ -253,9 +253,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));
-       if (! il)
-           adios (NULL, "couldn't allocate msg list");
+       il = mh_xcalloc(mp->hghsel + 1, sizeof *il);
        for (i = 0; i < nmsgs; i++)
            il[slist[i]->s_msg] = &slist[i];
        /*
@@ -287,6 +285,7 @@ main (int argc, char **argv)
            }
        }
        *fp = 0;
+       free (il);
        free (slist);
        free (dlist);
        dlist = flist;
@@ -316,12 +315,7 @@ read_hdrs (struct msgs *mp, char *datesw)
 
     twscopy (&tb, dlocaltimenow ());
 
-    smsgs = (struct smsg *)
-       calloc ((size_t) (mp->hghsel - mp->lowsel + 2),
-           sizeof(*smsgs));
-    if (smsgs == NULL)
-       adios (NULL, "unable to allocate sort storage");
-
+    smsgs = mh_xcalloc(mp->hghsel - mp->lowsel + 2, sizeof *smsgs);
     s = smsgs;
     for (msgnum = mp->lowsel; msgnum <= mp->hghsel; msgnum++) {
        if (is_selected(mp, msgnum)) {