tm: fix warning: may be used uninitialized in this function

(cherry picked from commit 76ad065338e6970c09c5ed8bc0f84fd2bfdf0ac2)
tmx: fix warning: may be used uninitialized in this function

(cherry picked from commit 022ae9be87b11838345a3d22b1170b280aef8aa7)
Merge branch '4.2' into lazedo/4.2.1