From the Prophet ﷺ, with the same meaning as Malik's narration, but he did not mention "otherwise, whatever has been freed of him is freed." His hadith ends at "and the slave is freed in his favor," with the same meaning.
حدثنا عبد الله بن محمد بن أسماء حدثنا جويرية عن نافع
عن النبي ﷺ بمعنى مالك ولم يذكر وإلا فقد عتق منه ما عتق انتهى حديثه إلى وأعتق عليه العبد على معناه
No references are available.
Bukhari narrated it in the Chapter on Partnership, in the section on partnership in slaves, hadith no. 2503, from the hadith of Juwayria bin Asma, through this same chain.