Fixed an issue that may crash the game
caused by did not free up the candidate structure memory after using it.