From 6856975ed4ce79355752d08938f066f2ed9fcfb5 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Thu, 22 Jul 2021 18:38:16 +0530 Subject: mcheck Fix malloc_usable_size [BZ #22057] Interpose malloc_usable_size to return the correct mcheck value for malloc_usable_size. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- malloc/malloc-debug.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'malloc/malloc-debug.c') diff --git a/malloc/malloc-debug.c b/malloc/malloc-debug.c index 34523b0cc3..9922ef5f25 100644 --- a/malloc/malloc-debug.c +++ b/malloc/malloc-debug.c @@ -399,6 +399,8 @@ strong_alias (__debug_calloc, calloc) size_t malloc_usable_size (void *mem) { + if (__is_malloc_debug_enabled (MALLOC_MCHECK_HOOK)) + return mcheck_usable_size (mem); if (__is_malloc_debug_enabled (MALLOC_CHECK_HOOK)) return malloc_check_get_size (mem); -- cgit v1.2.3-70-g09d2