Fix cppcheck reassignment warning