Free dynamically allocated memory.