Fix some scan coverity reports
Merge pull request #36 from serval2412/master

Fix some scan coverity reports