1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

Don't fill allocated memory with 0xFD when debugging is

enabled. It hides errors from Valgrind.
This commit is contained in:
Lasse Collin 2008-03-10 13:41:25 +02:00
parent c0e19e0662
commit 45e43e1695

View file

@ -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;