cppcheck: Variable is reassigned a value before the old one has been used

Change-Id: Ifc16473c426bca2235e84b0d71291756074712bb