Sahih Muslim , Book 10, Hadith 3649 (USC-MSA)

Ibn 'Umar (Allah be pleased with them) reported that they were beaten during the lifetime of Allah's Messenger if they had bought foodgrains in bulk and then sold them in the spot without shifting them (to some other place).

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

sunnah.com