Fix coverity issues: CID 1231070,1231071,and 1231072.