Create function clean_string and free input_m.