Abdullah bin Abbas reported,

The Prophet ﷺ passed by two graves whose occupants were being punished. He said, "They are indeed being punished, but not for something major. As for one of them, he used to not shield himself from his urine. As for the other, he used to spread tale-bearing."Then he took a fresh palm branch, split it into two halves, and planted one on each grave.The companions asked, "Messenger of Allah, why did you do this?"He replied, "Perhaps their punishment will be lightened as long as these branches do not dry out."

Bukhari 1361

Sahih

حدثنا يحيى حدثنا أبو معاوية عن الأعمش عن مجاهد عن طاوس

عن ابن عباس رضي الله عنهما

عن النبي ﷺ أنه مر بقبرين يعذبان فقال إنهما ليعذبان وما يعذبان في كبير أما أحدهما فكان لا يستتر من البول وأما الآخر فكان يمشي بالنميمة ثم أخذ جريدة رطبة فشقها بنصفين ثم غرز في كل قبر واحدة فقالوا يا رسول الله لم صنعت هذا فقال لعله أن يخفف عنهما ما لم ييبسا

البخاري 1361صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Funerals
Chapter
Palm leaves on the grave
Numbering
Darussalam 1361
Bukhari 1361