Umar sent for me, and he mentioned the hadith. I said to the two of you that the Messenger of Allah ﷺ said, "We are not inherited from. Whatever we leave behind is charity."
حدثنا عبد الرزاق حدثنا معمر عن الزهري
أرسل إلي عمر رضي الله عنه فذكر الحديث فقلت لكما إن رسول الله ﷺ قال لا نورث ما تركنا صدقة
Its isnad is sahih. It occurs here in this abridged form, and it comes at length with the same isnad at 425. See also 172, 336, 337, 349. Muslim also related it at length, 2:52–53, through the route of Malik from Zuhri.