release dynamic memory allocation.