]> git.marmaro.de Git - mmh/blobdiff - uip/mhshow.c
* patch #3966: Create a mh_xmalloc function to prevent mistakes when
[mmh] / uip / mhshow.c
index 65f66f4a8bd0063422d0342c4fdfe1a876866148..c61e9170c5fd06d39d40c574f7f81003a0984f16 100644 (file)
@@ -20,6 +20,7 @@
 #include <h/mime.h>
 #include <h/mhparse.h>
 #include <h/mhcachesbr.h>
+#include <h/utils.h>
 
 #ifdef HAVE_SYS_WAIT_H
 # include <sys/wait.h>
@@ -169,8 +170,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