X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Futils.c;h=7c4ddcf26e46fe4256c0d39e1835958b4ffa27d9;hb=86048c14a070e3382577dd22519319bce77c70b9;hp=d822995ba251ed46c8d8a14ffa332f23840d4970;hpb=da831514de01e2407cef37c118ffff0526a486d0;p=mmh diff --git a/sbr/utils.c b/sbr/utils.c index d822995..7c4ddcf 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");