Fix a warning

--HG--
branch : release-2.x.y
Fix some coverity CWE-484 issues

--HG--
branch : release-2.x.y
Ifdef some dead code, fixing coverity bugs

--HG--
branch : release-2.x.y
Fix some Coverity CWE-457 bugs

--HG--
branch : release-2.x.y