In principle, it violates the contract of carraige. In practice, if you don't make a habit of it, they most probably won't bother chasing you down for the fare difference or confiscate your frequent flyer miles, etc., although they reserve the right to do these things.