X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/da831514de01e2407cef37c118ffff0526a486d0..d852091446f41b56c10a4163c9d00dd90eb2bc1b:/sbr/utils.c diff --git a/sbr/utils.c b/sbr/utils.c index d822995b..7c4ddcf2 100644 --- a/sbr/utils.c +++ b/sbr/utils.c @@ -47,6 +47,10 @@ mh_xrealloc(void *ptr, size_t size) { void *memory; + /* Some non-POSIX realloc()s don't cope with realloc(NULL,sz) */ + if (!ptr) + return mh_xmalloc(size); + if (size == 0) adios(NULL, "Tried to realloc 0bytes");