fix warning reported by cppcheck