summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2018-09-19 22:01:00 +0300
committerEugene Kosov <claprix@yandex.ru>2018-09-21 10:17:37 +0300
commit5b25dc6fa4bf63d783e8f8db73abc22ab111143b (patch)
tree283f6d4b1b51b56f32e972a65a7eabaf5e834c74 /mysys
parente43bc02e7b2752f0deb88cd1edc24d827e01dca9 (diff)
downloadmariadb-git-5b25dc6fa4bf63d783e8f8db73abc22ab111143b.tar.gz
MDEV-17248 Improve ASAN memory pool instrumentation
alloc_root(): unpoison only requested amount of bytes instead of a possible bigger aligned-sized buffer.
Diffstat (limited to 'mysys')
-rw-r--r--mysys/my_alloc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index 24e95d2c69c..e727f46be6d 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -184,6 +184,7 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
uchar* point;
reg1 USED_MEM *next= 0;
reg2 USED_MEM **prev;
+ size_t original_length = length;
DBUG_ENTER("alloc_root");
DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root));
DBUG_ASSERT(alloc_root_inited(mem_root));
@@ -241,7 +242,7 @@ void *alloc_root(MEM_ROOT *mem_root, size_t length)
mem_root->used= next;
mem_root->first_block_usage= 0;
}
- TRASH_ALLOC(point, length);
+ TRASH_ALLOC(point, original_length);
DBUG_PRINT("exit",("ptr: 0x%lx", (ulong) point));
DBUG_RETURN((void*) point);
#endif