malloc_usable_size returns the original size.
Bug: 16874447
Change-Id: Ie3ce683fd1f58b837b8ea91dc798e561b8593356
diff --git a/libc/bionic/malloc_debug_leak.cpp b/libc/bionic/malloc_debug_leak.cpp
index 837dccc..27b6714 100644
--- a/libc/bionic/malloc_debug_leak.cpp
+++ b/libc/bionic/malloc_debug_leak.cpp
@@ -481,11 +481,15 @@
return 0;
}
+ // TODO: Temporary workaround to avoid a crash b/16874447.
+ return header->entry->size & ~SIZE_FLAG_MASK;
+#if 0
size_t ret = g_malloc_dispatch->malloc_usable_size(header);
if (ret != 0) {
// The usable area starts at 'mem' and stops at 'header+ret'.
return reinterpret_cast<uintptr_t>(header) + ret - reinterpret_cast<uintptr_t>(mem);
}
+#endif
}
return 0;
}