To check for memory leaks, run these test programs through valgrind as follows: $ valgrind --leak-check=yes ./test_lit