]> git.marmaro.de Git - mmh/blobdiff - uip/install-mh.c
* patch #3966: Create a mh_xmalloc function to prevent mistakes when
[mmh] / uip / install-mh.c
index 34aed9505cdc4ff01ab6245ea0bfa5ec474bc834..ec847fb4548e481bb7f9e43d40b4ce800cffbd0f 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <h/mh.h>                              /* mh internals */
+#include <h/utils.h>
 #include <pwd.h>                               /* structure for getpwuid() results */
 
 static struct swit switches[] = {
@@ -180,8 +181,7 @@ query:
     /*
      * Add some initial elements to the profile/context list
      */
-    if (!(m_defs = (struct node *) malloc (sizeof *np)))
-       adios (NULL, "unable to allocate profile storage");
+    m_defs = (struct node *) mh_xmalloc (sizeof *np);
     np = m_defs;
     np->n_name = getcpy ("Path");
     np->n_field = getcpy (pathname);