[BUGFIX] Move variable initialisation to where it is needed (Revision 1)

Change-Id: Ie6e669a1e68eaa7bd83247a38df204d91ac0a093
Releases: master, 2.2, 2.1
Revision-Id: 10a43effaa0d5ba8d0283ddc894e965cac3c1e7d