quick sort valgrind error fixed