mirror of https://git.tukaani.org/xz.git
Don't fill allocated memory with 0xFD when debugging is
enabled. It hides errors from Valgrind.
This commit is contained in:
parent
c0e19e0662
commit
45e43e1695
|
@ -36,9 +36,10 @@ lzma_alloc(size_t size, lzma_allocator *allocator)
|
||||||
ptr = malloc(size);
|
ptr = malloc(size);
|
||||||
|
|
||||||
#if !defined(NDEBUG) && defined(HAVE_MEMSET)
|
#if !defined(NDEBUG) && defined(HAVE_MEMSET)
|
||||||
// This helps to catch some stupid mistakes.
|
// This helps to catch some stupid mistakes, but also hides them from
|
||||||
if (ptr != NULL)
|
// Valgrind. Uncomment when useful.
|
||||||
memset(ptr, 0xFD, size);
|
// if (ptr != NULL)
|
||||||
|
// memset(ptr, 0xFD, size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
|
|
Loading…
Reference in New Issue