Oooooooh. The Genie was the slave. I couldn't figure that one out. At first I wondered if it was related to Barry Lyndon since you mentioned watching it at the time you posted this. But that didn't fit. Then I was trying to go through plots where a main character woos a girl while aided by the help of a wiser person possible a servant. I was coming up with all sorts of wild choices like Arthur, Robin Hood: Prince of Thieves, or The Green Hornet. But they all had obvious flaws to match the description. Never occurred to me to think Disney.