Properly mallocs and frees hints in gethints().