fix problem found with clang analyzer