Sahih Muslim Book 32, Hadith Number 6295.
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.
Abu Huraira reported Allah’s Messenger (may peace be upon him) as saying: I have held covenant with Thee which Thou wouldst not break, so for any believer whom I curse or beat, make that an expiation on the Day of Resurrection.