I suggest deallocating the memory and running the unit test through valgrind to check for memory leaks.