Add Coverity scan script
Fix Coverity detected issue