Sema: Simplify code a bit, plug a potential leak.

No intended functionality change.