"Ibn 'Abbas was asked about a slave who divorces his wife twice, then (they are freed). Can he marry her? He said: 'Yes.' It was said to him: 'On what basis?' He said: 'The Messenger of Allah (ﷺ) passed such a judgement .' " (D a' if)
Sunan Ibn Majah Book 10, Hadith 67