Free memory for input