OSDN Git Service
(root)
/
android-x86
/
bionic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9560452
)
bionic: remove unneeded variable from chk_realloc()
author
André Goddard Rosa
<andre.goddard@gmail.com>
Fri, 5 Feb 2010 18:32:56 +0000
(16:32 -0200)
committer
André Goddard Rosa
<andre.goddard@gmail.com>
Fri, 5 Feb 2010 18:32:56 +0000
(16:32 -0200)
... and simplify the generated code.
Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
libc/bionic/malloc_leak.c
patch
|
blob
|
history
diff --git
a/libc/bionic/malloc_leak.c
b/libc/bionic/malloc_leak.c
index
305f954
..
ad1d2b4
100644
(file)
--- a/
libc/bionic/malloc_leak.c
+++ b/
libc/bionic/malloc_leak.c
@@
-665,8
+665,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);
}