mystring is allocated and freed again. without being used. maybe it should be removed?