X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=uip%2Fmark.c;h=03337229c679ed6360ba3990ed8ca209c6373f75;hp=aeed8667300ccf33fe203d9c219767538fd68a63;hb=fb49dd82ec42997b9df97f221c920f6596102c0a;hpb=6c42153ad9362cc676ea66563bf400d7511b3b68 diff --git a/uip/mark.c b/uip/mark.c index aeed866..0333722 100644 --- a/uip/mark.c +++ b/uip/mark.c @@ -12,6 +12,7 @@ */ #include +#include /* * We allocate space for messages (msgs array) @@ -81,8 +82,7 @@ main (int argc, char **argv) */ nummsgs = 0; maxmsgs = MAXMSGS; - if (!(msgs = (char **) malloc ((size_t) (maxmsgs * sizeof(*msgs))))) - adios (NULL, "unable to allocate storage"); + msgs = (char **) mh_xmalloc ((size_t) (maxmsgs * sizeof(*msgs))); /* * Parse arguments @@ -159,9 +159,8 @@ main (int argc, char **argv) */ if (nummsgs >= maxmsgs) { maxmsgs += MAXMSGS; - if (!(msgs = (char **) realloc (msgs, - (size_t) (maxmsgs * sizeof(*msgs))))) - adios (NULL, "unable to reallocate msgs storage"); + msgs = (char **) mh_xrealloc (msgs, + (size_t) (maxmsgs * sizeof(*msgs))); } msgs[nummsgs++] = cp; }