* patch #3966: Create a mh_xmalloc function to prevent mistakes when
[mmh] / uip / refile.c
index f3c6d1f..4d91291 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <h/mh.h>
+#include <h/utils.h>
 #include <fcntl.h>
 #include <errno.h>
 
@@ -97,8 +98,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