I heard the Messenger of Allah ﷺ say, "There is no one who makes a supplication but that Allah grants him what he asked for, or wards off from him an equivalent measure of harm, so long as he does not pray for something sinful or for the severing of family ties."
حدثنا قتيبة حدثنا ابن لهيعة عن أبي الزبير
سمعت رسول الله ﷺ يقول ما من أحد يدعو بدعاء إلا آتاه الله ما سأل أو كف عنه من السوء مثله ما لم يدع بإثم أو قطيعة رحم
[Sahih]. Ahmad (3/360) also reported it, from Qutayba, with the same chain, and the hadith has supporting narrations.There is also a narration on this topic from Abu Saeed [Ahmad 3/18, Bukhari in Adab al-Mufrad, no. 710, and Hakim 1/493] and from Ubada bin Samit [see no. 1571].