X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmhparse.c;h=fc24f5e13e8c30a832c6929a0bc45585ab6038fe;hp=c57e74587729ab9bab278dd41ef509d4124986b7;hb=81a21a9a97d8633f6d6231e31fdb6e328d0d3ff2;hpb=582d618b69077087961c367bd1631495906c92a8 diff --git a/uip/mhparse.c b/uip/mhparse.c index c57e745..fc24f5e 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef HAVE_SYS_WAIT_H # include @@ -584,8 +585,7 @@ add_header (CT ct, char *name, char *value) HF hp; /* allocate header field structure */ - if (!(hp = malloc (sizeof(*hp)))) - adios (NULL, "out of memory"); + hp = mh_xmalloc (sizeof(*hp)); /* link data into header structure */ hp->name = name; @@ -1303,8 +1303,7 @@ invalid_param: goto no_body; } - if ((e->eb_body = bp = malloc ((unsigned) size)) == NULL) - adios (NULL, "out of memory"); + e->eb_body = bp = mh_xmalloc ((unsigned) size); fseek (p->c_fp, p->c_begin, SEEK_SET); while (size > 0) switch (cc = fread (bp, sizeof(*bp), size, p->c_fp)) {