diff options
| author | The Android Open Source Project <initial-contribution@android.com> | 2010-03-22 15:55:09 -0700 |
|---|---|---|
| committer | The Android Open Source Project <initial-contribution@android.com> | 2010-03-22 15:55:09 -0700 |
| commit | 377d4c979dee3dcb5929e8f7a68a53c2407259ab (patch) | |
| tree | 1783fe0272f1437faabfe8365e615696eb8d374c /libc/bionic/malloc_debug_leak.c | |
| parent | 709a898de82128c065381e258e8e71f0a55df976 (diff) | |
| parent | 1825fb5d5f214849e39d95660795a0d3633f8eeb (diff) | |
| download | bionic-377d4c979dee3dcb5929e8f7a68a53c2407259ab.zip bionic-377d4c979dee3dcb5929e8f7a68a53c2407259ab.tar.gz bionic-377d4c979dee3dcb5929e8f7a68a53c2407259ab.tar.bz2 | |
merge from open-source master
Change-Id: I70266ee8c520b216773f267e46c8273d2334c31d
Diffstat (limited to 'libc/bionic/malloc_debug_leak.c')
| -rw-r--r-- | libc/bionic/malloc_debug_leak.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libc/bionic/malloc_debug_leak.c b/libc/bionic/malloc_debug_leak.c index e11606d..2ff8cee 100644 --- a/libc/bionic/malloc_debug_leak.c +++ b/libc/bionic/malloc_debug_leak.c @@ -430,8 +430,9 @@ void* chk_realloc(void* mem, size_t bytes) } if (new_buffer) { - size_t size = (bytes < old_bytes)?(bytes):(old_bytes); - memcpy(new_buffer, mem, size); + if (bytes > old_bytes) + bytes = old_bytes; + memcpy(new_buffer, mem, bytes); chk_free(mem); } |
