cppcheck: fix variableScope