Mishkat al-Masabih 2879
Makhlad b. Khufaf said:
I bought a slave and made him earn something for me, but afterwards I found a defect in him and so brought a case regarding him before ‘Umar b. ‘Abd al-‘Aziz, who decided in my favour that I should return him, but against me that I should return what he had earned. I therefore went to ‘Urwa and informed him, and he replied that he would go that evening to him and tell him he had been informed by ‘A'isha that God’s Messenger had given judgment in a similar case that any profit goes to the one who bears responsibility*. ‘Urwa went to him, and he gave judgment in my favour that I should receive the profit from the one for whom he had given the decision against me.
* al-Kharaj bid daman . After a sale any profit which accrues belongs to the buyer.

It is transmitted in Sharh as-sunna .
عَنْ مَخْلَدِ بْنِ خُفَافٍ قَالَ: ابْتَعْتُ غُلَامًا فَاسْتَغْلَلْتُهُ ثُمَّ ظَهَرْتُ مِنْهُ عَلَى عَيْبٍ فَخَاصَمْتُ فِيهِ إِلَى عُمَرَ بْنِ عَبْدِ الْعَزِيزِ فَقَضَى لِي بِرَدِّهِ وَقَضَى عَلَيَّ بِرَدِّ غَلَّتِهِ فَأَتَيْتُ عُرْوَةَ فَأَخْبَرْتُهُ فَقَالَ: أَرُوحُ إِلَيْهِ الْعَشِيَّةَ فَأُخْبِرُهُ أَنَّ عَائِشَةَ أَخْبَرَتْنِي أَنَّ رَسُولَ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ قَضَى فِي مِثْلِ هَذَا: أَنَّ الْخَرَاجَ بِالضَّمَانِ فَرَاحَ إِلَيْهِ عُرْوَةُ فَقَضَى لِي أَنْ آخُذَ الْخَرَاجَ مِنَ الَّذِي قَضَى بِهِ عَلَيِّ لَهُ. رَوَاهُ فِي شَرْحِ السُّنَّةِ