debugging: XMALLOC_POISON
[gitweb.git] / git-compat-util.h
index 93f558056dec457570bf2867dc6c75cd5891d2f2..3bcf5b13f2c7bab387b02bd3075629a9d14c5feb 100644 (file)
@@ -91,6 +91,9 @@ static inline void *xmalloc(size_t size)
                ret = malloc(1);
        if (!ret)
                die("Out of memory, malloc failed");
+#ifdef XMALLOC_POISON
+       memset(ret, 0xA5, size);
+#endif
        return ret;
 }