cppcheck: fix reassigned var

Change-Id: I20e421c216aa9053face25d00873928023ca859b