use valgrind to check memory leaks