fix resource leak reported as CID1100644