Abud-Darda' (May Allah be pleased with him) said:
The Messenger of Allah (ﷺ) said, "When a person curses somebody or something, the curse goes up to heaven and the gates of heaven get closed. Then it comes down to the earth and its gates get closed. Then it turns right and left, and if it does not find an entrance to go anywhere, it returns to the person or thing that was cursed; if he or it deserves to be cursed; otherwise it returns to the person who uttered it."[Abu Dawud].
App reference: Book 18, Hadith 46
Arabic/English book reference: Book 18, Hadith 1556