It is narrated from Kharijah bin Zayd bin Thabit that when Sayyiduna Zayd (may Allah be pleased with him) grew old, he suffered from continuous urine leakage. He would treat it as much as he was able, and when it overcame him, he performed ablution and prayed.
A hadith of similar meaning has been narrated with a chain that contains weakness.
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الحيض / 1670