diff options
author | David Turner <digit@android.com> | 2010-03-30 14:52:14 -0700 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2010-03-30 14:52:14 -0700 |
commit | f8916e2e4547da691b1de9149a23b9b254a4f7ad (patch) | |
tree | 0f52437bba08eea66821b0e178d7c0a9cc1fc582 /libc | |
parent | acdb052030d6e537e51d8b42e07b2a9e71e6ee42 (diff) | |
parent | 3f6121278194404f89ea7b22f098e9389e954587 (diff) | |
download | bionic-f8916e2e4547da691b1de9149a23b9b254a4f7ad.zip bionic-f8916e2e4547da691b1de9149a23b9b254a4f7ad.tar.gz bionic-f8916e2e4547da691b1de9149a23b9b254a4f7ad.tar.bz2 |
Merge "bionic: clear only the part of the buffer which is not overwritten afterward"
Diffstat (limited to 'libc')
-rw-r--r-- | libc/bionic/malloc_leak.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libc/bionic/malloc_leak.c b/libc/bionic/malloc_leak.c index ad1d2b4..06f99fb 100644 --- a/libc/bionic/malloc_leak.c +++ b/libc/bionic/malloc_leak.c @@ -211,8 +211,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; |