I was told (at a drunken cast party long ago, so the details haven't stuck, I'm afraid) that leg doesn't refer to the body part. Rather, the expression supposedly refers to making a profit on the show or breaking through the curtain (or something -- man, I wish I could remember). Unless, of course, someone was pulling my leg!