Abdullah bin Abbas reported,

The Prophet ﷺ passed by one of the walled gardens of Medina, or Mecca, and heard the voices of two people being punished in their graves. The Prophet ﷺ said, "They are being punished, though not for anything major." Then he said, "Indeed, one of them did not shield himself from his urine, and the other used to go about spreading malicious gossip."He then called for a green palm branch, broke it into two pieces, and placed one piece on each of the two graves.Someone asked him, "Messenger of Allah, why did you do this?"He replied, "Perhaps their punishment will be lightened as long as these have not dried up, or until they dry up."

Bukhari 216

Sahih

حدثنا عثمان قال حدثنا جرير عن منصور عن مجاهد

عن ابن عباس قال

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

البخاري 216صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Wudu
Chapter
Not concealing oneself from urine is among the major sins
Numbering
Darussalam 216
Bukhari 216