/*
** 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");
/*
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;
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;
{
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;
}
/* 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;
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;
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);
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;
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;
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;
(q = &pq)->pq_next = NULL;
while ((cp = getname(ap))) {
if ((p = (struct pqpair *)
- calloc((size_t) 1, sizeof(*p))) == NULL)
+ mh_xcalloc((size_t) 1, sizeof(*p))) == NULL)
adios(EX_OSERR, NULL, "unable to allocate pqpair memory");
if ((mp = getm(cp, NULL, 0, AD_NAME, error)) == NULL) {
{
struct mcomp *c1;
- if ((c1 = (struct mcomp *) calloc((size_t) 1, sizeof(*c1))) == NULL)
+ if ((c1 = (struct mcomp *) mh_xcalloc((size_t) 1, sizeof(*c1))) == NULL)
adios(EX_OSERR, NULL, "unable to allocate comp memory");
c1->c_flags = flags & ~INIT;
return NOTOK;
}
- if ((base = (CT *) calloc((size_t) (i + 1), sizeof(*base))) == NULL)
+ if ((base = (CT *) mh_xcalloc((size_t) (i + 1), sizeof(*base))) == NULL)
adios(EX_OSERR, NULL, "out of memory");
ctq = base;
** check if message is coming from file
*/
if (file) {
- if (!(cts = (CT *) calloc((size_t) 2, sizeof(*cts))))
+ if (!(cts = (CT *) mh_xcalloc((size_t) 2, sizeof(*cts))))
adios(EX_OSERR, NULL, "out of memory");
ctp = cts;
exit(EX_USAGE);
seq_setprev(mp); /* set the previous-sequence */
- if (!(cts = (CT *) calloc((size_t) (mp->numsel + 1),
+ if (!(cts = (CT *) mh_xcalloc((size_t) (mp->numsel + 1),
sizeof(*cts))))
adios(EX_OSERR, NULL, "out of memory");
ctp = cts;
{
struct nexus *p;
- if ((p = (struct nexus *) calloc((size_t) 1, sizeof *p)) == NULL)
+ if ((p = (struct nexus *) mh_xcalloc((size_t) 1, sizeof *p)) == NULL)
adios(EX_OSERR, NULL, "unable to allocate component storage");
p->n_action = action;
format_len = strlen(cp);
ncomps = fmt_compile(cp, &fmt) + 1;
if (!(nxtbuf = compbuffers =
- (char **) calloc((size_t) ncomps, sizeof(char *)))) {
+ (char **) mh_xcalloc((size_t) ncomps, sizeof(char *)))) {
adios(EX_OSERR, NULL, "unable to allocate component buffers");
}
if (!(savecomp = used_buf =
- (struct comp **) calloc((size_t) (ncomps + 1),
+ (struct comp **) mh_xcalloc((size_t) (ncomps + 1),
sizeof(struct comp *)))) {
adios(EX_OSERR, NULL, "unable to allocate component buffer stack");
}
ncomps = fmt_compile(cp, &fmt) + 1;
if (!(nxtbuf = compbuffers = (char **)
- calloc((size_t) ncomps, sizeof(char *))))
+ mh_xcalloc((size_t) ncomps, sizeof(char *))))
adios(EX_OSERR, NULL, "unable to allocate component buffers");
if (!(savecomp = used_buf = (struct comp **)
- calloc((size_t) (ncomps+1), sizeof(struct comp *))))
+ mh_xcalloc((size_t) (ncomps+1), sizeof(struct comp *))))
adios(EX_OSERR, NULL, "unable to allocate component buffer stack");
savecomp += ncomps + 1;
*--savecomp = NULL; /* point at zero'd end minus 1 */