Fix the coverity issues

This PR is to resolve issues raised by coverity.

BUG=XWALK-2928
Sorry for misunderstanding your meaning. I will modify it now.