summaryrefslogtreecommitdiffstats
path: root/libc/bionic
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2010-04-08 11:11:53 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2010-04-08 11:11:53 -0700
commit95faecefdea0f55edafdba09052a904df7cd2405 (patch)
tree953a43567de93a20f4074a0617292e799f9915ab /libc/bionic
parentf1cd18bdec3686c072bc10cbf66e671b07fc4fde (diff)
parent350bb359fa5e31e3dfae8be6b1ce7ee3495f0da7 (diff)
downloadbionic-95faecefdea0f55edafdba09052a904df7cd2405.zip
bionic-95faecefdea0f55edafdba09052a904df7cd2405.tar.gz
bionic-95faecefdea0f55edafdba09052a904df7cd2405.tar.bz2
merge from open-source master
Change-Id: If77618a329fc7b497c44c2585e644bc50e7e1406
Diffstat (limited to 'libc/bionic')
-rw-r--r--libc/bionic/malloc_debug_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libc/bionic/malloc_debug_common.c b/libc/bionic/malloc_debug_common.c
index a86255a..ec56826 100644
--- a/libc/bionic/malloc_debug_common.c
+++ b/libc/bionic/malloc_debug_common.c
@@ -149,7 +149,7 @@ void get_malloc_leak_info(uint8_t** info, size_t* overallSize,
if (*info == NULL) {
*overallSize = 0;
- goto done;
+ goto out_nomem_info;
}
qsort((void*)list, gHashTable.count, sizeof(void*), hash_entry_compare);
@@ -161,8 +161,7 @@ void get_malloc_leak_info(uint8_t** info, size_t* overallSize,
size_t entrySize = (sizeof(size_t) * 2) + (sizeof(intptr_t) * entry->numEntries);
if (entrySize < *infoSize) {
/* we're writing less than a full entry, clear out the rest */
- /* TODO: only clear out the part we're not overwriting? */
- memset(head, 0, *infoSize);
+ memset(head + entrySize, 0, *infoSize - entrySize);
} else {
/* make sure the amount we're copying doesn't exceed the limit */
entrySize = *infoSize;
@@ -171,6 +170,7 @@ void get_malloc_leak_info(uint8_t** info, size_t* overallSize,
head += *infoSize;
}
+out_nomem_info:
dlfree(list);
done: