fix clang-analyzer warnings

Reviewer: @kenchiang

New warnings from Clang 3.4.