X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhl.c;h=15489ff6631eb65e941d75420100e78e92342509;hp=c201a9511a54657114612b4d122b4154c9ae079b;hb=10eff860a28b96582526eb739fd0a55441669938;hpb=cf1205b5cbea2f0cd6ea710ec16c637df85b647c diff --git a/uip/mhl.c b/uip/mhl.c index c201a95..15489ff 100644 --- a/uip/mhl.c +++ b/uip/mhl.c @@ -674,7 +674,7 @@ mhlfile(FILE *fp, char *mname, int ofilen, int ofilec) continue; } if (dobody && !mh_strcasecmp(c1->c_name, "body")) { - holder.c_text = mh_xmalloc(sizeof(buf)); + holder.c_text = mh_xcalloc(sizeof(buf), sizeof(char)); strncpy(holder.c_text, buf, sizeof(buf)); while (state == BODY) { putcomp(c1, &holder, BODYCOMP); @@ -780,9 +780,7 @@ mcomp_format(struct mcomp *c1, struct mcomp *c2) (q = &pq)->pq_next = NULL; while ((cp = getname(ap))) { - if ((p = (struct pqpair *) - calloc((size_t) 1, sizeof(*p))) == NULL) - adios(EX_OSERR, NULL, "unable to allocate pqpair memory"); + p = (struct pqpair *) mh_xcalloc((size_t) 1, sizeof(*p)); if ((mp = getm(cp, NULL, 0, AD_NAME, error)) == NULL) { p->pq_text = getcpy(cp); @@ -829,8 +827,7 @@ add_queue(struct mcomp **head, struct mcomp **tail, char *name, { struct mcomp *c1; - if ((c1 = (struct mcomp *) calloc((size_t) 1, sizeof(*c1))) == NULL) - adios(EX_OSERR, NULL, "unable to allocate comp memory"); + c1 = (struct mcomp *) mh_xcalloc((size_t) 1, sizeof(*c1)); c1->c_flags = flags & ~INIT; if ((c1->c_name = name ? getcpy(name) : NULL))