The Prophet ﷺ said, "There is no man who memorizes knowledge and then conceals it except that he will be brought on the Day of Resurrection bridled with a bridle of fire."Abu Hasan, namely al-Qattan, said, Abu Hatim narrated to us, Abu Walid narrated to us, Umarah bin Zazan narrated to us, and he mentioned something similar.
حدثنا أبو بكر بن أبي شيبة حدثنا أسود بن عامر حدثنا عمارة بن زاذان حدثنا علي بن الحكم حدثنا عطاء
أن النبي ﷺ قال ما من رجل يحفظ علما فيكتمه إلا أتي به يوم القيامة ملجما بلجام من النار قال أبو الحسن أي القطان وحدثنا أبو حاتم حدثنا أبو الوليد حدثنا عمارة بن زاذان فذكر نحوه
[Hasan] Reported by Abu Dawud, Knowledge, chapter on the dislike of withholding knowledge, no. 3658, and Tirmidhi, no. 2649, from the hadith of Ali bin Hakam, with this wording, and he said, "Hasan." Ibn Hibban graded it sahih, no. 95, and it has corroborating narrations in Ibn Hibban, no. 96, and Hakim (1/102), and others.