X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/da831514de01e2407cef37c118ffff0526a486d0..4a6d6b0b6d7c306c3d73e39a6a76f016ff60a6b1:/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");