free allocated memory to keep valgrind happy