Answer: Escape from the Cave of Wonders
Jafar, disguised as an old man, tricked Aladdin into visiting the Cave of Wonders, so he could get the genie's lamp and hand it over. The plan nearly worked until Abu caused Jafar to drop the lamp. Aladdin became stuck in the cave where he released the genie. He was able to trick the genie into freeing the two of them, along with Abu and the magic carpet, from the cave. Genie allowed this request without it counting as one of Aladdin's three wishes but told him that there would be no more freebies.