aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-03-10 13:41:25 +0200
committerLasse Collin <lasse.collin@tukaani.org>2008-03-10 13:41:25 +0200
commit45e43e169527e7a98a8c8a821d37bf25822b764d (patch)
tree850272fed9f6d36aa7c08131752dc35e1fa53d96 /src
parentRemove two redundant validity checks from the LZMA decoder. (diff)
downloadxz-45e43e169527e7a98a8c8a821d37bf25822b764d.tar.xz
Don't fill allocated memory with 0xFD when debugging is
enabled. It hides errors from Valgrind.
Diffstat (limited to 'src')
-rw-r--r--src/liblzma/common/allocator.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/liblzma/common/allocator.c b/src/liblzma/common/allocator.c
index edea0f68..c5970312 100644
--- a/src/liblzma/common/allocator.c
+++ b/src/liblzma/common/allocator.c
@@ -36,9 +36,10 @@ lzma_alloc(size_t size, lzma_allocator *allocator)
ptr = malloc(size);
#if !defined(NDEBUG) && defined(HAVE_MEMSET)
- // This helps to catch some stupid mistakes.
- if (ptr != NULL)
- memset(ptr, 0xFD, size);
+ // This helps to catch some stupid mistakes, but also hides them from
+ // Valgrind. Uncomment when useful.
+// if (ptr != NULL)
+// memset(ptr, 0xFD, size);
#endif
return ptr;