fix valgrind error in ubuntu 12.04