]> diplodocus.org Git - nmh/blobdiff - sbr/utils.c
Put parameter names in h/utils.h memory function prototypes.
[nmh] / sbr / utils.c
index 0766809d9df06c92e361ff96af0884df911f8d81..5b7b19f12b9082f8c4b280ca227a7fcf3576bf11 100644 (file)
@@ -76,6 +76,13 @@ void *mh_xcalloc(size_t nelem, size_t elsize)
     return p;
 }
 
     return p;
 }
 
+/* Call free(3), if ptr isn't NULL. */
+void mh_xfree(void *ptr)
+{
+    if (ptr)
+        free(ptr); /* Some very old platforms can't cope with NULL. */
+}
+
 /*
  * Return the present working directory, if the current directory does not
  * exist, or is too long, make / the pwd.
 /*
  * Return the present working directory, if the current directory does not
  * exist, or is too long, make / the pwd.