X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhlsbr.c;h=31c24bb11bdd58588480cb58fd8615253d7753f4;hp=c310e2a075da5cef080664040361355f402caf87;hb=389877bae1fe1a9f7259b8979f6a930744d90fab;hpb=31d4900d02d6be96308736ddc262ec4cdbd72c7c diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index c310e2a..31c24bb 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -955,8 +956,7 @@ mhlfile (FILE *fp, char *mname, int ofilen, int ofilec) continue; } if (dobody && !strcasecmp (c1->c_name, "body")) { - if ((holder.c_text = malloc (sizeof(buf))) == NULL) - adios (NULL, "unable to allocate buffer memory"); + holder.c_text = mh_xmalloc (sizeof(buf)); strncpy (holder.c_text, buf, sizeof(buf)); while (state == BODY) { putcomp (c1, &holder, BODYCOMP); @@ -1644,14 +1644,12 @@ doface (struct mcomp *c1) if (cp) { int j; char *dp; - if ((dp = realloc (cp, (unsigned) (j = len + i))) == NULL) - adios (NULL, "unable to allocate face storage"); + dp = mh_xrealloc (cp, (unsigned) (j = len + i)); memcpy(dp + len, buffer, i); cp = dp, len = j; } else { - if ((cp = malloc ((unsigned) i)) == NULL) - adios (NULL, "unable to allocate face storage"); + cp = mh_xmalloc ((unsigned) i); memcpy(cp, buffer, i); len = i; }