Bottom line, ear infections and flying are a no-go. You could always try to move the inbound flight to later. Call and see what UA says, back it up with a doctor's note if required. Never been in this situation, so can't say for sure what UA would do, but they would work with you I would assume.