Fixing TAINTED_SCALAR defect reported by Coverity