summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2006-08-08 12:23:47 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2006-08-08 12:24:13 -0700
commitaa5481c1af08edbca821a0d025d26e9bc41a5c49 (patch)
tree285a6b86946e39b154bf83220ee46d7f9addc9fc
parentannotate: Fix bug when parsing merges with differing real and logical parents. (diff)
downloadtgif-aa5481c1af08edbca821a0d025d26e9bc41a5c49.tar.xz
debugging: XMALLOC_POISON
Compile with -DXMALLOC_POISON=1 to catch errors from using uninitialized memory returned by xmalloc. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--git-compat-util.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 93f558056d..3bcf5b13f2 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -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;
}