Commit 62b702d568ae0e764219ea47e165556f7b39392b

Authored by Loic Dachary
Committed by Loic Dachary
1 parent 8fe7382e
Exists in master and in 1 other branch v3

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>
Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
src/gf.c
... ... @@ -910,7 +910,8 @@ void gf_multby_one(void *src, void *dest, int bytes, int xor)
910 910 gf_region_data rd;
911 911  
912 912 if (!xor) {
913   - memcpy(dest, src, bytes);
  913 + if (dest != src)
  914 + memcpy(dest, src, bytes);
914 915 return;
915 916 }
916 917 uls = (unsigned long) src;
... ...