do not memcpy if src and dst are the same

This is harmless really but triggers a valgrind error.

Signed-off-by: Loic Dachary <loic@dachary.org>
master
Loic Dachary 2015-01-11 11:03:17 +01:00 committed by Loic Dachary
parent 8fe7382e2a
commit 62b702d568
1 changed files with 2 additions and 1 deletions

View File

@ -910,7 +910,8 @@ void gf_multby_one(void *src, void *dest, int bytes, int xor)
gf_region_data rd;
if (!xor) {
memcpy(dest, src, bytes);
if (dest != src)
memcpy(dest, src, bytes);
return;
}
uls = (unsigned long) src;