Release allocated memory