The Messenger of Allah ﷺ passed by two graves and said, "These two are being punished, and they are not being punished for something major. One of them used to spread tales, and the other did not shield himself from his urine."He then called for a fresh palm branch, split it in two, and planted one piece on each grave, saying, "Perhaps their punishment will be lightened so long as these do not dry out."In another narration, "The other did not keep himself clean from urine."
مر رسول الله ﷺ على قبرين، فقال: أما إنهما ليعذبان، وما يعذبان في كبير، أما أحدهما فكان يمشي بالنميمة، وأما الآخر فكان لا يستتر من بوله. قال: فدعا بعسيب رطب فشقه باثنين، ثم غرس على هذا واحدا، وعلى هذا واحدا، ثم قال: لعله يخفف عنهما ما لم ييبسا. وفي رواية: وكان الآخر لا يستنزه عن البول، أو من البول.
Bukhari narrated it in wudu (218) and in funerals (1361), and Muslim in purification (292), both through Amash, who said, I heard Mujahid narrating from Tawus, from Ibn Abbas... and he related the hadith. The wording given here is that of Muslim. In Bukhari's wording, it reads, then he took a fresh palm branch... It also contains, they said, "O Messenger of Allah, why did you do this?" He said, "Perhaps it will lighten their punishment as long as they have not dried out."