fxed Coverity resources leaks. CID 1187601, 1187600,
1187599, 1187598, 1187596, 1187595.