commit | a9c41a8e0a62f70a37f7040740a9b1ef06a66612 | [log] [tgz] |
---|---|---|
author | David Turner <digit@android.com> | Tue Mar 16 17:26:44 2010 -0700 |
committer | Android Code Review <code-review@android.com> | Tue Mar 16 17:26:44 2010 -0700 |
tree | 6cb6780bb885e4431d7fc16d9a651cbea2fe4cf4 | |
parent | 3f192f55f06610a4aff8ce88548cfa4d1607f0e3 [diff] | |
parent | 291100c795fc98f4a1320e7de0dbef2615cd8fb9 [diff] |
Merge "bionic: remove unneeded variable from chk_realloc()"
diff --git a/libc/bionic/malloc_leak.c b/libc/bionic/malloc_leak.c index 305f954..ad1d2b4 100644 --- a/libc/bionic/malloc_leak.c +++ b/libc/bionic/malloc_leak.c
@@ -665,8 +665,9 @@ } 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); }