summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7c49cb2)
raw | patch | inline | side by side (parent: 7c49cb2)
author | Junio C Hamano <junkio@cox.net> | |
Tue, 8 Aug 2006 19:23:47 +0000 (12:23 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 8 Aug 2006 19:24:13 +0000 (12:24 -0700) |
Compile with -DXMALLOC_POISON=1 to catch errors from using uninitialized
memory returned by xmalloc.
Signed-off-by: Junio C Hamano <junkio@cox.net>
memory returned by xmalloc.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-compat-util.h | patch | blob | history |
diff --git a/git-compat-util.h b/git-compat-util.h
index 93f558056dec457570bf2867dc6c75cd5891d2f2..3bcf5b13f2c7bab387b02bd3075629a9d14c5feb 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
ret = malloc(1);
if (!ret)
die("Out of memory, malloc failed");
+#ifdef XMALLOC_POISON
+ memset(ret, 0xA5, size);
+#endif
return ret;
}