[FIX] resolving all issues reported by clang analyzer