got rid of malloc and added and made sure to free max_url in unambiguous_url