Lionel Messi may not want to retire at Barcelona, and his new contract will have a clause that gives him that option.
According to multiple reports in Spain, the Blaugrana superstar is very close to signing an extension that will keep him at the club until 2022. All of the financial aspects of the deal have been agreed (salary, buyout fee, etc), but there is just one more detail left before the renewal is official.
Messi wants to include a clause in his new deal that will allow him to leave the club at any point for free, but Messi will only activate such clause so he can return to his childhood club, Newell's Old Boys, the team that discovered him when he was a small kid in Rosario, Argentina. Leo wants to play the final season of his career at Newell's, and he wants to make it easier for them to sign him.
Very few clubs on Earth can actually afford to buy Messi away from Barça (his new buyout fee will be set at €300 million, sources told Barca Blaugranes), and Newell's are definitely not one of them. The Catalan giants will never sell Messi and if Leo retired as a Blaugrana, they wouldn't make any money anyway, so they will not oppose Leo's decision to leave the club and join Newell's for free. The club accepts Messi's clause, and the contract will be signed in the upcoming weeks after the final details are agreed upon.
We would obviously want to see Messi retire as a Barça player, but Argentine stars all want to retire for their childhood teams, and Leo is no different.