From Sahih Muslim (Hadith 2491):
Abu Huraira reported:Whenever the Messenger of Allah (ﷺ) was presented with food, he asked about it, If he was told that it was a gift, he ate out of that, and if he was told that it was a sadaqa he did not eat out of that
Reference: Muslim 2491