- if ((memory = calloc(nmemb, size))) {
- return memory;
- } else {
- adios(NULL, "calloc failed");
- }
+ p = calloc(nelem, elsize);
+ if (!p)
+ adios(NULL, "calloc failed, size wanted: %zu * %zu", nelem, elsize);
+
+ 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. */