MB-8991: Fix dangling pointer usage!

Change-Id: Ic8fb0023cd82badd418b235d5055de3d508c4fcc
Build using CMake

Change-Id: I4c1af45be1b2f1e2112e323ba839405249815b4a