Clear the contents of the input buffer before free()ing.