am 95faecef: merge from open-source master

This commit is contained in:
The Android Open Source Project 2010-04-08 11:23:30 -07:00 committed by Android Git Automerger
commit 424dff854c

View File

@ -149,7 +149,7 @@ void get_malloc_leak_info(uint8_t** info, size_t* overallSize,
if (*info == NULL) { if (*info == NULL) {
*overallSize = 0; *overallSize = 0;
goto done; goto out_nomem_info;
} }
qsort((void*)list, gHashTable.count, sizeof(void*), hash_entry_compare); 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); size_t entrySize = (sizeof(size_t) * 2) + (sizeof(intptr_t) * entry->numEntries);
if (entrySize < *infoSize) { if (entrySize < *infoSize) {
/* we're writing less than a full entry, clear out the rest */ /* we're writing less than a full entry, clear out the rest */
/* TODO: only clear out the part we're not overwriting? */ memset(head + entrySize, 0, *infoSize - entrySize);
memset(head, 0, *infoSize);
} else { } else {
/* make sure the amount we're copying doesn't exceed the limit */ /* make sure the amount we're copying doesn't exceed the limit */
entrySize = *infoSize; entrySize = *infoSize;
@ -171,6 +170,7 @@ void get_malloc_leak_info(uint8_t** info, size_t* overallSize,
head += *infoSize; head += *infoSize;
} }
out_nomem_info:
dlfree(list); dlfree(list);
done: done: