If he paid the dues of Allah, then that is fine. Abu Dharr raised his stick and struck Kaʿb, and said: I heard the Messenger of Allah ﷺ say: ʿI would not like to have this mountain in gold and spend it (for the sake of Allah) and Allah accept it from me, and leave behind six Ooqiyyah of it.” I adjure you by Allah, O ʿUthman, did you hear him? - [He said it] three times, He said: Yes.
عُثْمَانُ يَا كَعْبُ إِنَّ عَبْدَ الرَّحْمَنِ تُوُفِّيَ وَتَرَكَ مَالًا فَمَا تَرَى فِيهِ؟ فَقَالَ إِنْ كَانَ يَصِلُ فِيهِ حَقَّ اللهِ فَلا بَأْسَ عَلَيْهِ فَرَفَعَ أَبُو ذَرٍّ عَصَاهُ فَضَرَبَ كَعْبًا وَقَالَ سَمِعْتُ رَسُولَ اللهِ ﷺ يَقُولُ مَا أُحِبُّ لَوْ أَنَّ لِي هَذَا الْجَبَلَ ذَهَبًا أُنْفِقُهُ وَيُتَقَبَّلُ مِنِّي أَذَرُ خَلْفِي مِنْهُ سِتَّ أَوَاقٍ أَنْشُدُكَ اللهَ يَا عُثْمَانُ أَسَمِعْتَهُ ثَلاثَ مَرَّاتٍ ؟ قَالَ نَعَمْ