* patch #3966: Create a mh_xmalloc function to prevent mistakes when
[mmh] / uip / anno.c
index dca93eb..d90e0f6 100644 (file)
@@ -46,6 +46,7 @@
  */
 
 #include <h/mh.h>
+#include <h/utils.h>
 
 /*
  * We allocate space for messages (msgs array)
@@ -127,8 +128,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)));
 
     while ((cp = *argp++)) {
        if (*cp == '-') {