repair memlack by valgrind