The Prophet ﷺ was asked about hanging fruit. He said, "Whoever takes some of it out of need, without carrying any away in his garment, there is no penalty upon him."
حدثنا قتيبة حدثنا الليث عن ابن عجلان
أن النبي ﷺ سئل عن الثمر المعلق فقال من أصاب منه من ذي حاجة غير متخذ خبنة فلا شيء عليه
Its isnad is hasan. Abu Dawud narrated it in the chapter on lost property, on the section about announcing lost property, hadith 1710, and Nasai, hadith 961, from Qutayba with the same wording, and Ibn Jarud graded it sahih, hadith 827, as did Ibn Khuzayma, hadith 2327 and 2328.