Ata' narrates from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever says to his wife: 'You are divorced, In sha' Allah (if Allah wills)', or says to his slave: 'You are free, In sha' Allah (if Allah wills)', or (says) that he will walk to the House of Allah, In sha' Allah (if Allah wills), then nothing is binding upon him."
Abu Ahmad (Ibn Adi) said: This hadith, with its chain, is munkar (denounced); no one narrates it except Ishaq al-Ka'bi. Al-Shaykh (al-Bayhaqi) said: It has also been narrated from al-Jarud bin Yazid, from Bahz bin Hakim, from his father, from his grandfather, as marfu' (attributed to the Prophet), concerning divorce alone, and it too is da'if (weak). The hadith of Ibn Umar (may Allah be pleased with him) suffices, and success is from Allah.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الخلع والطلاق / 15123