]> git.ipfire.org Git - thirdparty/git.git/blobdiff - wrapper.c
config.mak.uname: remove unused the NO_R_TO_GCC_LINKER flag
[thirdparty/git.git] / wrapper.c
index 4ff4a9c3db0e1c797bce777eac5358d74c0bc5c6..bcda41e3744c1f0a94b7717c67a7f85195088821 100644 (file)
--- a/wrapper.c
+++ b/wrapper.c
@@ -117,10 +117,13 @@ void *xrealloc(void *ptr, size_t size)
 {
        void *ret;
 
+       if (!size) {
+               free(ptr);
+               return xmalloc(0);
+       }
+
        memory_limit_check(size, 0);
        ret = realloc(ptr, size);
-       if (!ret && !size)
-               ret = realloc(ptr, 1);
        if (!ret)
                die("Out of memory, realloc failed");
        return ret;