Sahih Muslim Book 032, Hadith Number 6297.
Chapter : He upon whom Allah's Apostle (may peace be upon him) invoked curse whereas he in fact did not deserve it, it would be a source of reward and mercy for him.
Anas b. Malik reported that there was an orphan girl with Umm Sulaim (who was the mother of Anas). Allah's Messenger (may peace be upon him) saw that orphan girl and said: O, it is you; you have grown young. May you not advance in years! That slave-girl returned to Umm Sulaim weeping. Umm Sulaim said: O daughter, what is the matter with you? She said: Allah's Apostle (may peace be upon him) has invoked curse upon me that I should not grow in age and thus I would never grow in age, or she said, in my (length) of life. Umm Sulaim went out wrapping her head-dress hurriedly until she met Allah's Messenger (may peace be upon him). He said to her: Umm Sulaim, what is the matter with you? She said: Allah's Apostle, you invoked curse upon my orphan girl. He said: Umm Sulaim, what is that? She said: She (the orphan girl) states you have cursed her saying that she might not grow in age or grow in life. Allah's Messenger (may peace be upon him) smiled and then said: Umm Sulaim, don't you know that I have made this term with my Lord. And the term with my Lord is that I said to Him: I am a human being and I am pleased just as a human being is pleased and I lose temper just as a human being loses temper, so for any person from amongst my Ummah whom I curse and he in no way deserves it, let that, O Lord, be made a source of purification and purity and nearness to (Allah) on the Day of Resurrection.