|
From: <sv...@va...> - 2016-10-05 19:27:54
|
Author: philippe
Date: Wed Oct 5 20:27:47 2016
New Revision: 16024
Log:
Fix n-i-bz bug in auto free pool: a block using the last byte of the meta
pool was not auto-freed.
This was shown by:
./vg-in-place --leak-check=full ./memcheck/tests/leak-autofreepool 2 100
Without the patch, it reports 101 blocks leaked, with one block
being from the auto-free meta pool.
With the fix, there is (as expected) 100 leaked blocks.
Modified:
trunk/memcheck/mc_malloc_wrappers.c
Modified: trunk/memcheck/mc_malloc_wrappers.c
==============================================================================
--- trunk/memcheck/mc_malloc_wrappers.c (original)
+++ trunk/memcheck/mc_malloc_wrappers.c Wed Oct 5 20:27:47 2016
@@ -698,7 +698,7 @@
VG_(HT_ResetIter)(MC_(malloc_list));
while (!found && (mc = VG_(HT_Next)(MC_(malloc_list))) ) {
- if (mc->data >= StartAddr && mc->data + mc->szB < EndAddr) {
+ if (mc->data >= StartAddr && mc->data + mc->szB <= EndAddr) {
if (VG_(clo_verbosity) > 2) {
VG_(message)(Vg_UserMsg, "Auto-free of 0x%lx size=%lu\n",
mc->data, (mc->szB + 0UL));
|