Fix exceptional resource leak (CID18460)
Fix exceptional resource leak (CID50175)