list.h: fixed a memory leak in the test, no memory leaks in the implementation