Fixed segmentation fault during input free.