X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/3910a511d4d9ad19e5eeff769881f4e52f498947..34f0ab116ad7734e96127d3cd046861a5c82c11c:/sbr/utils.c diff --git a/sbr/utils.c b/sbr/utils.c index 0766809d..5b7b19f1 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -76,6 +76,13 @@ void *mh_xcalloc(size_t nelem, size_t 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. */ +} + /* * Return the present working directory, if the current directory does not * exist, or is too long, make / the pwd.