[Misc] Avoid declaring a variable if it is unreferenced before a possible exit point.