[12423] Fix some issues shown by Cppcheck

(based on commit [12313] - cd84dcb)