Corrected a memory deallocation error