Hadithcore
Sahih Muslim, 1962 b
sahih

Anas b. Malik reported that Allah's Messenger (ﷺ) offered the 'Id prayer and then delivered the sermon giving the command:

He who slaughtered the animal before prayer should slaughter (another animal as a sacrifice). The rest of the hadith is the same.

حَدَّثَنَا مُحَمَّدُ بْنُ عُبَيْدٍ الْغُبَرِيُّ، حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، حَدَّثَنَا أَيُّوبُ، وَهِشَامٌ، عَنْ مُحَمَّدٍ، عَنْ أَنَسِ بْنِ مَالِكٍ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم صَلَّى ثُمَّ خَطَبَ فَأَمَرَ مَنْ كَانَ ذَبَحَ قَبْلَ الصَّلاَةِ أَنْ يُعِيدَ ذِبْحًا ثُمَّ ذَكَرَ بِمِثْلِ حَدِيثِ ابْنِ عُلَيَّةَ ‏.‏

References2 variants
In-Book Reference
Book 35, Hadith 17
USC-MSA web (English) reference
Book 22, Hadith 4834 (deprecated numbering scheme)