Fix CID #44343
Fix CID #44342
Fix CID #44352
Fix CID #44351
Use manual ref and delete to hopefully fix CID #44349
Fix CID #44348
Fix CID #44344, #44347
Fix CID #44345
Hopefully fix CID #44341
Hopefully fix CID #44340
Fix CID #44339
Hopefully fix remaining Coverity issues (#45211, #45210, #44349)
Merge branch 'master' into coverity_fixes
Merge pull request #194 from hpicgs/coverity_fixes

Coverity fixes