replaced calloc with mh_xcalloc
[mmh] / uip / mhbuild.c
index de2cf45..140cfdb 100644 (file)
@@ -329,7 +329,7 @@ build_mime(char *infile)
        /*
        ** Allocate space for primary (outside) content
        */
-       if ((ct = (CT) calloc(1, sizeof(*ct))) == NULL)
+       if ((ct = (CT) mh_xcalloc(1, sizeof(*ct))) == NULL)
                adios(EX_OSERR, NULL, "out of memory");
 
        /*
@@ -430,7 +430,7 @@ finish_field:
        ct->c_subtype = MULTI_MIXED;
        ct->c_file = getcpy(infile);
 
-       if ((m = (struct multipart *) calloc(1, sizeof(*m))) == NULL)
+       if ((m = (struct multipart *) mh_xcalloc(1, sizeof(*m))) == NULL)
                adios(EX_OSERR, NULL, "out of memory");
        ct->c_ctparams = (void *) m;
        pp = &m->mp_parts;
@@ -450,7 +450,7 @@ finish_field:
                if (!p)
                        continue;
 
-               if ((part = (struct part *) calloc(1, sizeof(*part))) == NULL)
+               if ((part = (struct part *) mh_xcalloc(1, sizeof(*part))) == NULL)
                        adios(EX_OSERR, NULL, "out of memory");
                *pp = part;
                pp = &part->mp_next;
@@ -531,7 +531,7 @@ init_decoded_content(CT ct)
 {
        CE ce;
 
-       if ((ce = (CE) calloc(1, sizeof(*ce))) == NULL)
+       if ((ce = (CE) mh_xcalloc(1, sizeof(*ce))) == NULL)
                adios(EX_OSERR, NULL, "out of memory");
 
        ct->c_cefile     = ce;
@@ -592,7 +592,7 @@ user_content(FILE *in, char *file, char *buf, CT *ctp)
        }
 
        /* allocate basic Content structure */
-       if ((ct = (CT) calloc(1, sizeof(*ct))) == NULL)
+       if ((ct = (CT) mh_xcalloc(1, sizeof(*ct))) == NULL)
                adios(EX_OSERR, NULL, "out of memory");
        *ctp = ct;
 
@@ -902,7 +902,7 @@ use_forw:
                        ct->c_subtype = MULTI_DIGEST;
 
                        if ((m = (struct multipart *)
-                                       calloc(1, sizeof(*m))) == NULL)
+                                       mh_xcalloc(1, sizeof(*m))) == NULL)
                                adios(EX_OSERR, NULL, "out of memory");
                        ct->c_ctparams = (void *) m;
                        pp = &m->mp_parts;
@@ -913,7 +913,7 @@ use_forw:
                                        CT p;
                                        CE pe;
 
-                                       if ((p = (CT) calloc(1, sizeof(*p)))
+                                       if ((p = (CT) mh_xcalloc(1, sizeof(*p)))
                                                        == NULL)
                                                adios(EX_OSERR, NULL, "out of memory");
                                        init_decoded_content(p);
@@ -929,7 +929,7 @@ use_forw:
                                                        msgnum);
                                        pe->ce_file = getcpy(buffer);
 
-                                       if ((part = (struct part *) calloc(1, sizeof(*part))) == NULL)
+                                       if ((part = (struct part *) mh_xcalloc(1, sizeof(*part))) == NULL)
                                                adios(EX_OSERR, NULL, "out of memory");
                                        *pp = part;
                                        pp = &part->mp_next;
@@ -989,7 +989,7 @@ use_forw:
                ct->c_type = CT_MULTIPART;
                ct->c_subtype = vrsn;
 
-               if ((m = (struct multipart *) calloc(1, sizeof(*m))) == NULL)
+               if ((m = (struct multipart *) mh_xcalloc(1, sizeof(*m))) == NULL)
                        adios(EX_OSERR, NULL, "out of memory");
                ct->c_ctparams = (void *) m;
 
@@ -1007,7 +1007,7 @@ use_forw:
                                continue;
 
                        if ((part = (struct part *)
-                                       calloc(1, sizeof(*part))) == NULL)
+                                       mh_xcalloc(1, sizeof(*part))) == NULL)
                                adios(EX_OSERR, NULL, "out of memory");
                        *pp = part;
                        pp = &part->mp_next;