bionic: remove unneeded variable from chk_realloc()

... and simplify the generated code.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
This commit is contained in:
André Goddard Rosa 2010-02-05 16:32:56 -02:00
parent 95604529ec
commit 291100c795

View File

@ -665,8 +665,9 @@ void* chk_realloc(void* mem, size_t bytes)
} }
if (new_buffer) { if (new_buffer) {
size_t size = (bytes < old_bytes)?(bytes):(old_bytes); if (bytes > old_bytes)
memcpy(new_buffer, mem, size); bytes = old_bytes;
memcpy(new_buffer, mem, bytes);
chk_free(mem); chk_free(mem);
} }